Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: ui/aura/root_window.cc

Issue 10690168: Aura: Resize locks with --ui-enable-threaded-compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New approach. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 159a1c6931c8cbdedac8a9d5fdc0099e526c665b..06efff7aad8cf7ea7b6fd6e8239e2cc4203eded8 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -42,8 +42,6 @@ namespace aura {
namespace {
-const int kCompositorLockTimeoutMs = 67;
-
// Returns true if |target| has a non-client (frame) component at |location|,
// in window coordinates.
bool IsNonClientLocation(Window* target, const gfx::Point& location) {
@@ -82,25 +80,6 @@ void SetLastMouseLocation(const Window* root_window,
} // namespace
-CompositorLock::CompositorLock(RootWindow* root_window)
- : root_window_(root_window) {
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&CompositorLock::CancelLock, AsWeakPtr()),
- base::TimeDelta::FromMilliseconds(kCompositorLockTimeoutMs));
-}
-
-CompositorLock::~CompositorLock() {
- CancelLock();
-}
-
-void CompositorLock::CancelLock() {
- if (!root_window_)
- return;
- root_window_->UnlockCompositor();
- root_window_ = NULL;
-}
-
bool RootWindow::hide_host_cursor_ = false;
////////////////////////////////////////////////////////////////////////////////
@@ -124,9 +103,7 @@ RootWindow::RootWindow(const gfx::Rect& initial_bounds)
draw_on_compositing_end_(false),
defer_draw_scheduling_(false),
mouse_move_hold_count_(0),
- ALLOW_THIS_IN_INITIALIZER_LIST(held_mouse_event_factory_(this)),
- compositor_lock_(NULL),
- draw_on_compositor_unlock_(false) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(held_mouse_event_factory_(this)) {
SetName("RootWindow");
compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget()));
@@ -135,12 +112,6 @@ RootWindow::RootWindow(const gfx::Rect& initial_bounds)
}
RootWindow::~RootWindow() {
- if (compositor_lock_) {
- // No need to schedule a draw, we're going away.
- draw_on_compositor_unlock_ = false;
- compositor_lock_->CancelLock();
- DCHECK(!compositor_lock_);
- }
compositor_->RemoveObserver(this);
// Make sure to destroy the compositor before terminating so that state is
// cleared and we don't hit asserts.
@@ -250,10 +221,6 @@ void RootWindow::Draw() {
draw_on_compositing_end_ = true;
return;
}
- if (compositor_lock_) {
- draw_on_compositor_unlock_ = true;
- return;
- }
waiting_on_compositing_end_ = true;
TRACE_EVENT_ASYNC_BEGIN0("ui", "RootWindow::Draw",
@@ -389,12 +356,6 @@ void RootWindow::ReleaseMouseMoves() {
}
}
-scoped_refptr<CompositorLock> RootWindow::GetCompositorLock() {
- if (!compositor_lock_)
- compositor_lock_ = new CompositorLock(this);
- return compositor_lock_;
-}
-
void RootWindow::SetFocusWhenShown(bool focused) {
host_->SetFocusWhenShown(focused);
}
@@ -438,9 +399,7 @@ void RootWindow::SetTransform(const ui::Transform& transform) {
// RootWindow, ui::CompositorDelegate implementation:
void RootWindow::ScheduleDraw() {
- if (compositor_lock_) {
- draw_on_compositor_unlock_ = true;
- } else if (!defer_draw_scheduling_) {
+ if (!defer_draw_scheduling_) {
defer_draw_scheduling_ = true;
MessageLoop::current()->PostTask(
FROM_HERE,
@@ -451,12 +410,6 @@ void RootWindow::ScheduleDraw() {
////////////////////////////////////////////////////////////////////////////////
// RootWindow, ui::CompositorObserver implementation:
-void RootWindow::OnCompositingDidCommit(ui::Compositor*) {
-}
-
-void RootWindow::OnCompositingWillStart(ui::Compositor*) {
-}
-
void RootWindow::OnCompositingStarted(ui::Compositor*) {
}
@@ -1033,13 +986,4 @@ void RootWindow::SynthesizeMouseMoveEvent() {
#endif
}
-void RootWindow::UnlockCompositor() {
- DCHECK(compositor_lock_);
- compositor_lock_ = NULL;
- if (draw_on_compositor_unlock_) {
- draw_on_compositor_unlock_ = false;
- ScheduleDraw();
- }
-}
-
} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698