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

Unified Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 2373253004: Return VisualVewport bounds in screen coordinates (DIP) in GpuBenchmarking::VisualViewportXXX method (Closed)
Patch Set: . Created 4 years, 3 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/gpu/gpu_benchmarking_extension.cc
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc
index 88e14fac59ae60e80a49bf1f4cd6e94be46c9a73..e5454049a5d982928b16c55ccb8eac99c6bccd03 100644
--- a/content/renderer/gpu/gpu_benchmarking_extension.cc
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -854,28 +854,40 @@ float GpuBenchmarking::VisualViewportY() {
GpuBenchmarkingContext context;
if (!context.Init(false))
return 0.0;
- return context.web_view()->visualViewportOffset().y;
+ float y = context.web_view()->visualViewportOffset().y;
+ blink::WebRect rect(0, y, 0, 0);
+ context.render_view_impl()->convertViewportToWindow(&rect);
+ return rect.y;
}
float GpuBenchmarking::VisualViewportX() {
GpuBenchmarkingContext context;
if (!context.Init(false))
return 0.0;
- return context.web_view()->visualViewportOffset().x;
+ float x = context.web_view()->visualViewportOffset().x;
+ blink::WebRect rect(x, 0, 0, 0);
+ context.render_view_impl()->convertViewportToWindow(&rect);
+ return rect.x;
}
float GpuBenchmarking::VisualViewportHeight() {
GpuBenchmarkingContext context;
if (!context.Init(false))
return 0.0;
- return context.web_view()->visualViewportSize().height;
+ float height = context.web_view()->visualViewportSize().height;
+ blink::WebRect rect(0, 0, 0, height);
+ context.render_view_impl()->convertViewportToWindow(&rect);
+ return rect.height;
}
float GpuBenchmarking::VisualViewportWidth() {
GpuBenchmarkingContext context;
if (!context.Init(false))
return 0.0;
- return context.web_view()->visualViewportSize().width;
+ float width = context.web_view()->visualViewportSize().width;
+ blink::WebRect rect(0, 0, width, 0);
+ context.render_view_impl()->convertViewportToWindow(&rect);
+ return rect.width;
}
bool GpuBenchmarking::Tap(gin::Arguments* args) {
« 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