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

Unified Diff: content/renderer/pepper/pepper_graphics_2d_host.cc

Issue 1964423003: Apply viewport to dip scale to Graphics2D, Compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 7 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/pepper/pepper_graphics_2d_host.cc
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc
index 200d3fde3414c641ea7b2b6698c2d7ccf51c0a8e..1e6bdd6d43ac7e711e0cdda01228e9ef5522a42c 100644
--- a/content/renderer/pepper/pepper_graphics_2d_host.cc
+++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -653,11 +653,15 @@ int32_t PepperGraphics2DHost::Flush(PP_Resource* old_image_data) {
// is visible to determine how to deal with the callback.
if (bound_instance_ && !op_rect.IsEmpty()) {
gfx::Point scroll_delta(operation.scroll_dx, operation.scroll_dy);
- if (!ConvertToLogicalPixels(scale_,
- &op_rect,
+ // In use-zoom-for-dsf mode, the viewport (thus cc) uses native
+ // pixels, so the damage and rects have to be scaled.
+ gfx::Rect op_rect_in_viewport = op_rect;
+ ConvertToLogicalPixels(scale_, &op_rect, nullptr);
+ if (!ConvertToLogicalPixels(scale_ / viewport_to_dip_scale_,
+ &op_rect_in_viewport,
operation.type == QueuedOperation::SCROLL
? &scroll_delta
- : NULL)) {
+ : nullptr)) {
// Conversion requires falling back to InvalidateRect.
operation.type = QueuedOperation::PAINT;
}
@@ -675,10 +679,10 @@ int32_t PepperGraphics2DHost::Flush(PP_Resource* old_image_data) {
// partially or completely off-screen.
if (operation.type == QueuedOperation::SCROLL) {
bound_instance_->ScrollRect(
- scroll_delta.x(), scroll_delta.y(), op_rect);
+ scroll_delta.x(), scroll_delta.y(), op_rect_in_viewport);
} else {
- if (!op_rect.IsEmpty())
- bound_instance_->InvalidateRect(op_rect);
+ if (!op_rect_in_viewport.IsEmpty())
+ bound_instance_->InvalidateRect(op_rect_in_viewport);
}
texture_mailbox_modified_ = true;
}
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.h ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698