Commit c94bdb6d authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

aura: Some cleanup.

Some of the parameters for the ui::Compositor that were added
for mus are no longer needed. Remove these.

BUG=none
TBR=oshima@ for trivial chromecast/ mechanical change

Change-Id: Ida403cca9391f3e3c5626b5dda5ef2e4c78b914c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2058035
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741749}
parent 3d5af675
......@@ -12,12 +12,8 @@ namespace chromecast {
CastWindowTreeHostAura::CastWindowTreeHostAura(
bool enable_input,
ui::PlatformWindowInitProperties properties,
bool use_external_frame_control)
: WindowTreeHostPlatform(std::move(properties),
nullptr,
nullptr,
use_external_frame_control),
ui::PlatformWindowInitProperties properties)
: WindowTreeHostPlatform(std::move(properties)),
enable_input_(enable_input) {
if (!enable_input)
window()->SetEventTargeter(std::make_unique<aura::NullWindowTargeter>());
......
......@@ -13,8 +13,7 @@ namespace chromecast {
class CastWindowTreeHostAura : public aura::WindowTreeHostPlatform {
public:
CastWindowTreeHostAura(bool enable_input,
ui::PlatformWindowInitProperties properties,
bool use_external_frame_control = false);
ui::PlatformWindowInitProperties properties);
~CastWindowTreeHostAura() override;
// aura::WindowTreeHostPlatform implementation:
......
......@@ -401,8 +401,7 @@ void WindowTreeHost::DestroyDispatcher() {
void WindowTreeHost::CreateCompositor(const viz::FrameSinkId& frame_sink_id,
bool force_software_compositor,
bool use_external_begin_frame_control,
const char* trace_environment_name) {
bool use_external_begin_frame_control) {
Env* env = Env::GetInstance();
ui::ContextFactory* context_factory = env->context_factory();
DCHECK(context_factory);
......@@ -414,8 +413,7 @@ void WindowTreeHost::CreateCompositor(const viz::FrameSinkId& frame_sink_id,
: context_factory_private->AllocateFrameSinkId(),
context_factory, context_factory_private,
base::ThreadTaskRunnerHandle::Get(), ui::IsPixelCanvasRecordingEnabled(),
use_external_begin_frame_control, force_software_compositor,
trace_environment_name);
use_external_begin_frame_control, force_software_compositor);
#if defined(OS_CHROMEOS)
compositor_->AddObserver(this);
#endif
......
......@@ -268,13 +268,11 @@ class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate,
void DestroyDispatcher();
// If frame_sink_id is not passed in, one will be grabbed from
// ContextFactoryPrivate. See Compositor() for details on
// |trace_environment_name|.
// ContextFactoryPrivate.
void CreateCompositor(
const viz::FrameSinkId& frame_sink_id = viz::FrameSinkId(),
bool force_software_compositor = false,
bool use_external_begin_frame_control = false,
const char* trace_environment_name = nullptr);
bool use_external_begin_frame_control = false);
void InitCompositor();
void OnAcceleratedWidgetAvailable();
......
......@@ -53,14 +53,10 @@ std::unique_ptr<WindowTreeHost> WindowTreeHost::Create(
WindowTreeHostPlatform::WindowTreeHostPlatform(
ui::PlatformWindowInitProperties properties,
std::unique_ptr<Window> window,
const char* trace_environment_name,
bool use_external_begin_frame_control)
std::unique_ptr<Window> window)
: WindowTreeHost(std::move(window)) {
bounds_in_pixels_ = properties.bounds;
CreateCompositor(viz::FrameSinkId(),
/* force_software_compositor */ false,
use_external_begin_frame_control, trace_environment_name);
CreateCompositor();
CreateAndSetPlatformWindow(std::move(properties));
}
......
......@@ -30,12 +30,8 @@ namespace aura {
class AURA_EXPORT WindowTreeHostPlatform : public WindowTreeHost,
public ui::PlatformWindowDelegate {
public:
// See Compositor() for details on |trace_environment_name|.
explicit WindowTreeHostPlatform(
ui::PlatformWindowInitProperties properties,
std::unique_ptr<Window> = nullptr,
const char* trace_environment_name = nullptr,
bool use_external_begin_frame_control = false);
explicit WindowTreeHostPlatform(ui::PlatformWindowInitProperties properties,
std::unique_ptr<Window> = nullptr);
~WindowTreeHostPlatform() override;
// WindowTreeHost:
......
......@@ -55,11 +55,6 @@
#include "ui/gl/gl_switches.h"
namespace ui {
namespace {
const char* kDefaultTraceEnvironmentName = "browser";
} // namespace
Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
ui::ContextFactory* context_factory,
......@@ -67,8 +62,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool enable_pixel_canvas,
bool use_external_begin_frame_control,
bool force_software_compositor,
const char* trace_environment_name)
bool force_software_compositor)
: context_factory_(context_factory),
context_factory_private_(context_factory_private),
frame_sink_id_(frame_sink_id),
......@@ -77,10 +71,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
force_software_compositor_(force_software_compositor),
layer_animator_collection_(this),
is_pixel_canvas_(enable_pixel_canvas),
lock_manager_(task_runner),
trace_environment_name_(trace_environment_name
? trace_environment_name
: kDefaultTraceEnvironmentName) {
lock_manager_(task_runner) {
if (context_factory_private) {
auto* host_frame_sink_manager =
context_factory_private_->GetHostFrameSinkManager();
......@@ -645,7 +636,7 @@ void Compositor::DidPresentCompositorFrame(
const gfx::PresentationFeedback& feedback) {
TRACE_EVENT_MARK_WITH_TIMESTAMP1("cc,benchmark", "FramePresented",
feedback.timestamp, "environment",
trace_environment_name_);
"browser");
}
void Compositor::DidSubmitCompositorFrame() {
......
......@@ -175,17 +175,13 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
public cc::LayerTreeHostSingleThreadClient,
public viz::HostFrameSinkClient {
public:
// |trace_environment_name| is passed to trace events so that tracing
// can identify the environment the trace events are from. Examples are,
// "ash", and "browser". If no value is supplied, "browser" is used.
Compositor(const viz::FrameSinkId& frame_sink_id,
ui::ContextFactory* context_factory,
ui::ContextFactoryPrivate* context_factory_private,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool enable_pixel_canvas,
bool use_external_begin_frame_control = false,
bool force_software_compositor = false,
const char* trace_environment_name = nullptr);
bool force_software_compositor = false);
~Compositor() override;
ui::ContextFactory* context_factory() { return context_factory_; }
......@@ -478,8 +474,6 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
// Set in DisableSwapUntilResize and reset when a resize happens.
bool disabled_swap_until_resize_ = false;
const char* trace_environment_name_;
base::WeakPtrFactory<Compositor> context_creation_weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(Compositor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment