Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index 8ecb0b3952e3cd6a1cff6d9a0119d1192bad8d66..442329cb6ee3f90f58d2c77aaf194910825a8799 100644 |
--- a/content/renderer/render_widget.cc |
+++ b/content/renderer/render_widget.cc |
@@ -580,6 +580,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 |
@@ -591,7 +594,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* dib = NULL; |
std::vector<gfx::Rect> copy_rects; |
gfx::Rect optimized_copy_rect, optimized_copy_location; |
@@ -643,7 +646,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(); |
@@ -901,8 +904,8 @@ void RenderWidget::OnMsgPaintAtSize(const TransportDIB::Handle& dib_handle, |
int tag, |
const gfx::Size& page_size, |
const gfx::Size& desired_size) { |
- if (!webwidget_ || !TransportDIB::is_valid(dib_handle)) { |
- if (TransportDIB::is_valid(dib_handle)) { |
+ if (!webwidget_ || !TransportDIB::is_valid_handle(dib_handle)) { |
+ if (TransportDIB::is_valid_handle(dib_handle)) { |
// Close our unused handle. |
#if defined(OS_WIN) |
::CloseHandle(dib_handle); |