summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 14:15:56 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 14:15:56 +0000
commit7df588fbddab01beecf3f996b41e917f4e81b5a9 (patch)
treefe964c1e1f493c4bc371f36263fee61a9203c205 /ui
parent54f7cfb28db2e6d26c7a997b50187768adb4ffae (diff)
downloadchromium_src-7df588fbddab01beecf3f996b41e917f4e81b5a9.zip
chromium_src-7df588fbddab01beecf3f996b41e917f4e81b5a9.tar.gz
chromium_src-7df588fbddab01beecf3f996b41e917f4e81b5a9.tar.bz2
Plumb expose damage to compositor.
When running with --ui-enable-partial-swap, we need to plumb expose damage to the compositor damage tracker. BUG=111403 TEST=run an Aura build with --use-gl=osmesa --ui-enable-partial-swap; turn off compositing WM; move a window over top; see damage redrawn Review URL: http://codereview.chromium.org/9374022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/root_window.cc4
-rw-r--r--ui/aura/root_window.h3
-rw-r--r--ui/aura/root_window_host_linux.cc2
-rw-r--r--ui/gfx/compositor/compositor.cc4
-rw-r--r--ui/gfx/compositor/compositor.h5
5 files changed, 17 insertions, 1 deletions
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 9ba501a..742d265 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -133,6 +133,10 @@ void RootWindow::Draw() {
compositor_->Draw(false);
}
+void RootWindow::ScheduleFullDraw() {
+ compositor_->ScheduleFullDraw();
+}
+
bool RootWindow::DispatchMouseEvent(MouseEvent* event) {
static const int kMouseButtonFlagMask =
ui::EF_LEFT_MOUSE_BUTTON |
diff --git a/ui/aura/root_window.h b/ui/aura/root_window.h
index 740b259..917b0c0 100644
--- a/ui/aura/root_window.h
+++ b/ui/aura/root_window.h
@@ -92,6 +92,9 @@ class AURA_EXPORT RootWindow : public ui::CompositorDelegate,
// Draws the necessary set of windows.
void Draw();
+ // Draw the whole screen.
+ void ScheduleFullDraw();
+
// Handles a mouse event. Returns true if handled.
bool DispatchMouseEvent(MouseEvent* event);
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index b234623..0459ad9 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -400,7 +400,7 @@ base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch(
switch (xev->type) {
case Expose:
- root_window_->ScheduleDraw();
+ root_window_->ScheduleFullDraw();
handled = true;
break;
case KeyPress: {
diff --git a/ui/gfx/compositor/compositor.cc b/ui/gfx/compositor/compositor.cc
index cd143a9..4fa47a4 100644
--- a/ui/gfx/compositor/compositor.cc
+++ b/ui/gfx/compositor/compositor.cc
@@ -194,6 +194,10 @@ void Compositor::Draw(bool force_clear) {
NotifyEnd();
}
+void Compositor::ScheduleFullDraw() {
+ host_.setNeedsRedraw();
+}
+
bool Compositor::ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds) {
if (bounds.right() > size().width() || bounds.bottom() > size().height())
return false;
diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h
index d946572..f289d84 100644
--- a/ui/gfx/compositor/compositor.h
+++ b/ui/gfx/compositor/compositor.h
@@ -125,6 +125,11 @@ class COMPOSITOR_EXPORT Compositor
// compositing.
void Draw(bool force_clear);
+ // Where possible, draws are scissored to a damage region calculated from
+ // changes to layer properties. This bypasses that and indicates that
+ // the whole frame needs to be drawn.
+ void ScheduleFullDraw();
+
// Reads the region |bounds| of the contents of the last rendered frame
// into the given bitmap.
// Returns false if the pixels could not be read.