| 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 cecaddfea20411b1334aeda4dcb99984c172741b..7630616dad6a78e7137358cb895e0138df7f2880 100644
|
| --- a/content/renderer/gpu/gpu_benchmarking_extension.cc
|
| +++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
|
| @@ -495,6 +495,9 @@ gin::ObjectTemplateBuilder GpuBenchmarking::GetObjectTemplateBuilder(
|
| .SetMethod("swipe", &GpuBenchmarking::Swipe)
|
| .SetMethod("scrollBounce", &GpuBenchmarking::ScrollBounce)
|
| .SetMethod("pinchBy", &GpuBenchmarking::PinchBy)
|
| + .SetMethod("pageScaleFactor", &GpuBenchmarking::PageScaleFactor)
|
| + .SetMethod("visualViewportX", &GpuBenchmarking::VisualViewportX)
|
| + .SetMethod("visualViewportY", &GpuBenchmarking::VisualViewportY)
|
| .SetMethod("visualViewportHeight", &GpuBenchmarking::VisualViewportHeight)
|
| .SetMethod("visualViewportWidth", &GpuBenchmarking::VisualViewportWidth)
|
| .SetMethod("tap", &GpuBenchmarking::Tap)
|
| @@ -762,6 +765,7 @@ bool GpuBenchmarking::PinchBy(gin::Arguments* args) {
|
| scoped_ptr<SyntheticPinchGestureParams> gesture_params(
|
| new SyntheticPinchGestureParams);
|
|
|
| + // TODO(bokan): Remove page scale here when change land in Catapult.
|
| // Convert coordinates from CSS pixels to density independent pixels (DIPs).
|
| float page_scale_factor = context.web_view()->pageScaleFactor();
|
|
|
| @@ -788,6 +792,27 @@ bool GpuBenchmarking::PinchBy(gin::Arguments* args) {
|
| return true;
|
| }
|
|
|
| +float GpuBenchmarking::PageScaleFactor() {
|
| + GpuBenchmarkingContext context;
|
| + if (!context.Init(false))
|
| + return 0.0;
|
| + return context.web_view()->pageScaleFactor();
|
| +}
|
| +
|
| +float GpuBenchmarking::VisualViewportY() {
|
| + GpuBenchmarkingContext context;
|
| + if (!context.Init(false))
|
| + return 0.0;
|
| + return context.web_view()->visualViewportOffset().y;
|
| +}
|
| +
|
| +float GpuBenchmarking::VisualViewportX() {
|
| + GpuBenchmarkingContext context;
|
| + if (!context.Init(false))
|
| + return 0.0;
|
| + return context.web_view()->visualViewportOffset().x;
|
| +}
|
| +
|
| float GpuBenchmarking::VisualViewportHeight() {
|
| GpuBenchmarkingContext context;
|
| if (!context.Init(false))
|
|
|