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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10916279: Chromium compositor change implementing page-scale driven pinch-zoom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rebaselined to 160422. Created 8 years, 2 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 | « content/renderer/render_view_impl.h ('k') | webkit/compositor_bindings/WebCompositorImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
===================================================================
--- content/renderer/render_view_impl.cc (revision 160422)
+++ content/renderer/render_view_impl.cc (working copy)
@@ -2465,6 +2465,8 @@
routing_id_, input_handler_identifier, AsWeakPtr());
RenderWidget::didActivateCompositor(input_handler_identifier);
+
+ ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess());
}
// WebKit::WebFrameClient -----------------------------------------------------
@@ -3144,19 +3146,9 @@
command_line.HasSwitch(switches::kEnableViewport);
bool enable_fixed_layout =
command_line.HasSwitch(switches::kEnableFixedLayout);
- bool enable_pinch = enable_viewport ||
- command_line.HasSwitch(switches::kEnablePinch);
webview()->enableFixedLayoutMode(enable_fixed_layout || enable_viewport);
webview()->settings()->setFixedElementsLayoutRelativeToFrame(true);
- if (!enable_pinch &&
- webview()->isAcceleratedCompositingActive() &&
- webkit_preferences_.apply_default_device_scale_factor_in_compositor &&
- device_scale_factor_ != 1) {
- // Page scaling is disabled by default when applying a scale factor in the
- // compositor since they are currently incompatible.
- webview()->setPageScaleFactorLimits(1, 1);
- }
if (enable_viewport) {
webview()->settings()->setViewportEnabled(true);
@@ -3172,8 +3164,33 @@
webview()->setFixedLayoutSize(WebSize(width, height));
}
}
+
+ ProcessAcceleratedPinchZoomFlags(command_line);
}
+void RenderViewImpl::ProcessAcceleratedPinchZoomFlags(
+ const CommandLine& command_line) {
+ bool enable_viewport =
+ command_line.HasSwitch(switches::kEnableViewport);
+ bool enable_pinch = enable_viewport ||
+ command_line.HasSwitch(switches::kEnablePinch);
+ bool enable_pinch_in_compositor =
+ command_line.HasSwitch(switches::kEnablePinchInCompositor);
+
+ if (!enable_pinch &&
+ webview()->isAcceleratedCompositingActive() &&
+ webkit_preferences_.apply_default_device_scale_factor_in_compositor &&
+ device_scale_factor_ != 1) {
+ // Page scaling is disabled by default when applying a scale factor in the
+ // compositor since they are currently incompatible.
+ webview()->setPageScaleFactorLimits(1, 1);
+ }
+
+ if (enable_pinch_in_compositor &&
+ webview()->isAcceleratedCompositingActive())
+ webview()->setPageScaleFactorLimits(1, 4);
+}
+
void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) {
WebDataSource* ds = frame->provisionalDataSource();
DocumentState* document_state = DocumentState::FromDataSource(ds);
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | webkit/compositor_bindings/WebCompositorImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698