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 { ...@@ -12,12 +12,8 @@ namespace chromecast {
CastWindowTreeHostAura::CastWindowTreeHostAura( CastWindowTreeHostAura::CastWindowTreeHostAura(
bool enable_input, bool enable_input,
ui::PlatformWindowInitProperties properties, ui::PlatformWindowInitProperties properties)
bool use_external_frame_control) : WindowTreeHostPlatform(std::move(properties)),
: WindowTreeHostPlatform(std::move(properties),
nullptr,
nullptr,
use_external_frame_control),
enable_input_(enable_input) { enable_input_(enable_input) {
if (!enable_input) if (!enable_input)
window()->SetEventTargeter(std::make_unique<aura::NullWindowTargeter>()); window()->SetEventTargeter(std::make_unique<aura::NullWindowTargeter>());
......
...@@ -13,8 +13,7 @@ namespace chromecast { ...@@ -13,8 +13,7 @@ namespace chromecast {
class CastWindowTreeHostAura : public aura::WindowTreeHostPlatform { class CastWindowTreeHostAura : public aura::WindowTreeHostPlatform {
public: public:
CastWindowTreeHostAura(bool enable_input, CastWindowTreeHostAura(bool enable_input,
ui::PlatformWindowInitProperties properties, ui::PlatformWindowInitProperties properties);
bool use_external_frame_control = false);
~CastWindowTreeHostAura() override; ~CastWindowTreeHostAura() override;
// aura::WindowTreeHostPlatform implementation: // aura::WindowTreeHostPlatform implementation:
...@@ -32,4 +31,4 @@ class CastWindowTreeHostAura : public aura::WindowTreeHostPlatform { ...@@ -32,4 +31,4 @@ class CastWindowTreeHostAura : public aura::WindowTreeHostPlatform {
} // namespace chromecast } // namespace chromecast
#endif // CHROMECAST_GRAPHICS_CAST_WINDOW_TREE_HOST_AURA_H_ #endif // CHROMECAST_GRAPHICS_CAST_WINDOW_TREE_HOST_AURA_H_
\ No newline at end of file
...@@ -401,8 +401,7 @@ void WindowTreeHost::DestroyDispatcher() { ...@@ -401,8 +401,7 @@ void WindowTreeHost::DestroyDispatcher() {
void WindowTreeHost::CreateCompositor(const viz::FrameSinkId& frame_sink_id, void WindowTreeHost::CreateCompositor(const viz::FrameSinkId& frame_sink_id,
bool force_software_compositor, bool force_software_compositor,
bool use_external_begin_frame_control, bool use_external_begin_frame_control) {
const char* trace_environment_name) {
Env* env = Env::GetInstance(); Env* env = Env::GetInstance();
ui::ContextFactory* context_factory = env->context_factory(); ui::ContextFactory* context_factory = env->context_factory();
DCHECK(context_factory); DCHECK(context_factory);
...@@ -414,8 +413,7 @@ void WindowTreeHost::CreateCompositor(const viz::FrameSinkId& frame_sink_id, ...@@ -414,8 +413,7 @@ void WindowTreeHost::CreateCompositor(const viz::FrameSinkId& frame_sink_id,
: context_factory_private->AllocateFrameSinkId(), : context_factory_private->AllocateFrameSinkId(),
context_factory, context_factory_private, context_factory, context_factory_private,
base::ThreadTaskRunnerHandle::Get(), ui::IsPixelCanvasRecordingEnabled(), base::ThreadTaskRunnerHandle::Get(), ui::IsPixelCanvasRecordingEnabled(),
use_external_begin_frame_control, force_software_compositor, use_external_begin_frame_control, force_software_compositor);
trace_environment_name);
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
compositor_->AddObserver(this); compositor_->AddObserver(this);
#endif #endif
......
...@@ -268,13 +268,11 @@ class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate, ...@@ -268,13 +268,11 @@ class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate,
void DestroyDispatcher(); void DestroyDispatcher();
// If frame_sink_id is not passed in, one will be grabbed from // If frame_sink_id is not passed in, one will be grabbed from
// ContextFactoryPrivate. See Compositor() for details on // ContextFactoryPrivate.
// |trace_environment_name|.
void CreateCompositor( void CreateCompositor(
const viz::FrameSinkId& frame_sink_id = viz::FrameSinkId(), const viz::FrameSinkId& frame_sink_id = viz::FrameSinkId(),
bool force_software_compositor = false, bool force_software_compositor = false,
bool use_external_begin_frame_control = false, bool use_external_begin_frame_control = false);
const char* trace_environment_name = nullptr);
void InitCompositor(); void InitCompositor();
void OnAcceleratedWidgetAvailable(); void OnAcceleratedWidgetAvailable();
......
...@@ -53,14 +53,10 @@ std::unique_ptr<WindowTreeHost> WindowTreeHost::Create( ...@@ -53,14 +53,10 @@ std::unique_ptr<WindowTreeHost> WindowTreeHost::Create(
WindowTreeHostPlatform::WindowTreeHostPlatform( WindowTreeHostPlatform::WindowTreeHostPlatform(
ui::PlatformWindowInitProperties properties, ui::PlatformWindowInitProperties properties,
std::unique_ptr<Window> window, std::unique_ptr<Window> window)
const char* trace_environment_name,
bool use_external_begin_frame_control)
: WindowTreeHost(std::move(window)) { : WindowTreeHost(std::move(window)) {
bounds_in_pixels_ = properties.bounds; bounds_in_pixels_ = properties.bounds;
CreateCompositor(viz::FrameSinkId(), CreateCompositor();
/* force_software_compositor */ false,
use_external_begin_frame_control, trace_environment_name);
CreateAndSetPlatformWindow(std::move(properties)); CreateAndSetPlatformWindow(std::move(properties));
} }
......
...@@ -30,12 +30,8 @@ namespace aura { ...@@ -30,12 +30,8 @@ namespace aura {
class AURA_EXPORT WindowTreeHostPlatform : public WindowTreeHost, class AURA_EXPORT WindowTreeHostPlatform : public WindowTreeHost,
public ui::PlatformWindowDelegate { public ui::PlatformWindowDelegate {
public: public:
// See Compositor() for details on |trace_environment_name|. explicit WindowTreeHostPlatform(ui::PlatformWindowInitProperties properties,
explicit WindowTreeHostPlatform( std::unique_ptr<Window> = nullptr);
ui::PlatformWindowInitProperties properties,
std::unique_ptr<Window> = nullptr,
const char* trace_environment_name = nullptr,
bool use_external_begin_frame_control = false);
~WindowTreeHostPlatform() override; ~WindowTreeHostPlatform() override;
// WindowTreeHost: // WindowTreeHost:
......
...@@ -55,11 +55,6 @@ ...@@ -55,11 +55,6 @@
#include "ui/gl/gl_switches.h" #include "ui/gl/gl_switches.h"
namespace ui { namespace ui {
namespace {
const char* kDefaultTraceEnvironmentName = "browser";
} // namespace
Compositor::Compositor(const viz::FrameSinkId& frame_sink_id, Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
ui::ContextFactory* context_factory, ui::ContextFactory* context_factory,
...@@ -67,8 +62,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id, ...@@ -67,8 +62,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool enable_pixel_canvas, bool enable_pixel_canvas,
bool use_external_begin_frame_control, bool use_external_begin_frame_control,
bool force_software_compositor, bool force_software_compositor)
const char* trace_environment_name)
: context_factory_(context_factory), : context_factory_(context_factory),
context_factory_private_(context_factory_private), context_factory_private_(context_factory_private),
frame_sink_id_(frame_sink_id), frame_sink_id_(frame_sink_id),
...@@ -77,10 +71,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id, ...@@ -77,10 +71,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
force_software_compositor_(force_software_compositor), force_software_compositor_(force_software_compositor),
layer_animator_collection_(this), layer_animator_collection_(this),
is_pixel_canvas_(enable_pixel_canvas), is_pixel_canvas_(enable_pixel_canvas),
lock_manager_(task_runner), lock_manager_(task_runner) {
trace_environment_name_(trace_environment_name
? trace_environment_name
: kDefaultTraceEnvironmentName) {
if (context_factory_private) { if (context_factory_private) {
auto* host_frame_sink_manager = auto* host_frame_sink_manager =
context_factory_private_->GetHostFrameSinkManager(); context_factory_private_->GetHostFrameSinkManager();
...@@ -645,7 +636,7 @@ void Compositor::DidPresentCompositorFrame( ...@@ -645,7 +636,7 @@ void Compositor::DidPresentCompositorFrame(
const gfx::PresentationFeedback& feedback) { const gfx::PresentationFeedback& feedback) {
TRACE_EVENT_MARK_WITH_TIMESTAMP1("cc,benchmark", "FramePresented", TRACE_EVENT_MARK_WITH_TIMESTAMP1("cc,benchmark", "FramePresented",
feedback.timestamp, "environment", feedback.timestamp, "environment",
trace_environment_name_); "browser");
} }
void Compositor::DidSubmitCompositorFrame() { void Compositor::DidSubmitCompositorFrame() {
......
...@@ -175,17 +175,13 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, ...@@ -175,17 +175,13 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
public cc::LayerTreeHostSingleThreadClient, public cc::LayerTreeHostSingleThreadClient,
public viz::HostFrameSinkClient { public viz::HostFrameSinkClient {
public: 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, Compositor(const viz::FrameSinkId& frame_sink_id,
ui::ContextFactory* context_factory, ui::ContextFactory* context_factory,
ui::ContextFactoryPrivate* context_factory_private, ui::ContextFactoryPrivate* context_factory_private,
scoped_refptr<base::SingleThreadTaskRunner> task_runner, scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool enable_pixel_canvas, bool enable_pixel_canvas,
bool use_external_begin_frame_control = false, bool use_external_begin_frame_control = false,
bool force_software_compositor = false, bool force_software_compositor = false);
const char* trace_environment_name = nullptr);
~Compositor() override; ~Compositor() override;
ui::ContextFactory* context_factory() { return context_factory_; } ui::ContextFactory* context_factory() { return context_factory_; }
...@@ -478,8 +474,6 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, ...@@ -478,8 +474,6 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
// Set in DisableSwapUntilResize and reset when a resize happens. // Set in DisableSwapUntilResize and reset when a resize happens.
bool disabled_swap_until_resize_ = false; bool disabled_swap_until_resize_ = false;
const char* trace_environment_name_;
base::WeakPtrFactory<Compositor> context_creation_weak_ptr_factory_{this}; base::WeakPtrFactory<Compositor> context_creation_weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(Compositor); 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