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

Unified Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc

Issue 10223009: ppapi Graphics2d should invalidate all changes without clipping to visible area. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed style issue, but still did not fit in one line Created 8 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
index 89cba977ea524a0df0f064edeed3802ea76f2257..3a6a1a8c57d3e9ed682be98bde62388af62b34a4 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
@@ -344,24 +344,29 @@ int32_t PPB_Graphics2D_Impl::Flush(PP_CompletionCallback callback) {
break;
}
- // We need the rect to be in terms of the current clip rect of the plugin
- // since that's what will actually be painted. If we issue an invalidate
- // for a clipped-out region, WebKit will do nothing and we won't get any
- // ViewWillInitiatePaint/ViewFlushedPaint calls, leaving our callback
- // stranded.
- gfx::Rect visible_changed_rect;
- if (bound_instance_ && !op_rect.IsEmpty())
- visible_changed_rect =PP_ToGfxRect(bound_instance_->view_data().clip_rect).
+ // For correctness with accelerated compositing, we must issue an invalidate
+ // on the full op_rect even if it is partially or completely off-screen.
+ // However, if we issue an invalidate for a clipped-out region, WebKit will
+ // do nothing and we won't get any ViewWillInitiatePaint/ViewFlushedPaint
+ // calls, leaving our callback stranded. So we still need to check whether
+ // the repainted area is visible to determine how to deal with the callback.
+ if (bound_instance_ && !op_rect.IsEmpty()) {
+
+ // Set |nothing_visible| to false if the change overlaps the visible area.
+ gfx::Rect visible_changed_rect =
+ PP_ToGfxRect(bound_instance_->view_data().clip_rect).
Intersect(op_rect);
+ if (!visible_changed_rect.IsEmpty())
+ nothing_visible = false;
- if (bound_instance_ && !visible_changed_rect.IsEmpty()) {
+ // Notify the plugin of the entire change (op_rect), even if it is
+ // partially or completely off-screen.
if (operation.type == QueuedOperation::SCROLL) {
bound_instance_->ScrollRect(operation.scroll_dx, operation.scroll_dy,
- visible_changed_rect);
+ op_rect);
} else {
- bound_instance_->InvalidateRect(visible_changed_rect);
+ bound_instance_->InvalidateRect(op_rect);
}
- nothing_visible = false;
}
}
queued_operations_.clear();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698