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

Unified Diff: chrome/renderer/render_widget.cc

Issue 6665029: Adds a TransportDIB::Id value that is explicitly invalid and use it when compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compiles on windows Created 9 years, 9 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: chrome/renderer/render_widget.cc
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index b19a87ca16cc626ee1e95bf02906b8b55f6987ff..28b1658ed800b973795b0d8d50eb82828f66b14a 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -576,6 +576,9 @@ void RenderWidget::DoDeferredUpdate() {
gfx::Rect scroll_damage = update.GetScrollDamage();
gfx::Rect bounds = update.GetPaintBounds().Union(scroll_damage);
+ // Compositing the page may disable accelerated compositing.
+ bool accelerated_compositing_was_active = is_accelerated_compositing_active_;
+
// A plugin may be able to do an optimized paint. First check this, in which
// case we can skip all of the bitmap generation and regular paint code.
// This optimization allows PPAPI plugins that declare themselves on top of
@@ -587,7 +590,7 @@ void RenderWidget::DoDeferredUpdate() {
// This optimization only works when the entire invalid region is contained
// within the plugin. There is a related optimization in PaintRect for the
// case where there may be multiple invalid regions.
- TransportDIB::Id dib_id = TransportDIB::Id();
+ TransportDIB::Id dib_id = TransportDIB::InvalidId();
TransportDIB* dib = NULL;
std::vector<gfx::Rect> copy_rects;
gfx::Rect optimized_copy_rect, optimized_copy_location;
@@ -639,7 +642,7 @@ void RenderWidget::DoDeferredUpdate() {
params.bitmap_rect = bounds;
params.dx = update.scroll_delta.x();
params.dy = update.scroll_delta.y();
- if (is_accelerated_compositing_active_) {
+ if (accelerated_compositing_was_active) {
// If painting is done via the gpu process then we clear out all damage
// rects to save the browser process from doing unecessary work.
params.scroll_rect = gfx::Rect();

Powered by Google App Engine
This is Rietveld 408576698