OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 : SkColorSetARGB(128, 128, 128, 128); | 274 : SkColorSetARGB(128, 128, 128, 128); |
275 settings.solid_color_scrollbar_thickness_dip = 3; | 275 settings.solid_color_scrollbar_thickness_dip = 3; |
276 settings.highp_threshold_min = 2048; | 276 settings.highp_threshold_min = 2048; |
277 // Android WebView handles root layer flings itself. | 277 // Android WebView handles root layer flings itself. |
278 settings.ignore_root_layer_flings = | 278 settings.ignore_root_layer_flings = |
279 widget->UsingSynchronousRendererCompositor(); | 279 widget->UsingSynchronousRendererCompositor(); |
280 #elif !defined(OS_MACOSX) | 280 #elif !defined(OS_MACOSX) |
281 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 281 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
282 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 282 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
283 settings.solid_color_scrollbars = true; | 283 settings.solid_color_scrollbars = true; |
| 284 } |
| 285 if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport) || |
| 286 cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
284 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 287 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
285 settings.solid_color_scrollbar_thickness_dip = 7; | 288 settings.solid_color_scrollbar_thickness_dip = 7; |
286 } | 289 } |
287 #endif | 290 #endif |
288 | 291 |
289 if (!compositor->initialize(settings)) | 292 if (!compositor->initialize(settings)) |
290 return scoped_ptr<RenderWidgetCompositor>(); | 293 return scoped_ptr<RenderWidgetCompositor>(); |
291 | 294 |
292 return compositor.Pass(); | 295 return compositor.Pass(); |
293 } | 296 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 590 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
588 } | 591 } |
589 | 592 |
590 scoped_refptr<cc::ContextProvider> | 593 scoped_refptr<cc::ContextProvider> |
591 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 594 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
592 return RenderThreadImpl::current()-> | 595 return RenderThreadImpl::current()-> |
593 OffscreenContextProviderForCompositorThread(); | 596 OffscreenContextProviderForCompositorThread(); |
594 } | 597 } |
595 | 598 |
596 } // namespace content | 599 } // namespace content |
OLD | NEW |