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

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

Issue 1969083002: Scale tickmark's coordinates to dip to viewport in use-zoom-for-dfs mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« 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: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 120a266411ddb06b6f9b603d19c19fd58d13cb2f..238ac71cb650009706a61b3a0c279f3e946a171b 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -119,6 +119,7 @@
#include "third_party/WebKit/public/web/WebView.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "ui/events/blink/blink_event_util.h"
+#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/range/range.h"
@@ -2598,10 +2599,12 @@ void PepperPluginInstanceImpl::SetTickmarks(PP_Instance instance,
blink::WebVector<blink::WebRect> tickmarks_converted(
static_cast<size_t>(count));
for (uint32_t i = 0; i < count; ++i) {
- tickmarks_converted[i] = blink::WebRect(tickmarks[i].point.x,
- tickmarks[i].point.y,
- tickmarks[i].size.width,
- tickmarks[i].size.height);
+ gfx::RectF tickmark(tickmarks[i].point.x,
+ tickmarks[i].point.y,
+ tickmarks[i].size.width,
+ tickmarks[i].size.height);
+ tickmark.Scale(1 / viewport_to_dip_scale_);
+ tickmarks_converted[i] = blink::WebRect(gfx::ToEnclosedRect(tickmark));
}
blink::WebLocalFrame* frame = render_frame_->GetWebFrame();
frame->setTickmarks(tickmarks_converted);
« 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