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

Unified Diff: content/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: mebbe this one compiles? 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: 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);
« content/common/common_param_traits.h ('K') | « content/renderer/pepper_plugin_delegate_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698