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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 265 |
266 #if defined(OS_ANDROID) | 266 #if defined(OS_ANDROID) |
267 // TODO(danakj): Move these to the android code. | 267 // TODO(danakj): Move these to the android code. |
268 settings.max_partial_texture_updates = 0; | 268 settings.max_partial_texture_updates = 0; |
269 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 269 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
270 settings.solid_color_scrollbars = true; | 270 settings.solid_color_scrollbars = true; |
271 settings.solid_color_scrollbar_color = | 271 settings.solid_color_scrollbar_color = |
272 cmd->HasSwitch(switches::kHideScrollbars) | 272 cmd->HasSwitch(switches::kHideScrollbars) |
273 ? SK_ColorTRANSPARENT | 273 ? SK_ColorTRANSPARENT |
274 : SkColorSetARGB(128, 128, 128, 128); | 274 : SkColorSetARGB(128, 128, 128, 128); |
275 settings.solid_color_scrollbar_thickness_dip = 3; | |
276 settings.highp_threshold_min = 2048; | 275 settings.highp_threshold_min = 2048; |
277 // Android WebView handles root layer flings itself. | 276 // Android WebView handles root layer flings itself. |
278 settings.ignore_root_layer_flings = | 277 settings.ignore_root_layer_flings = |
279 widget->UsingSynchronousRendererCompositor(); | 278 widget->UsingSynchronousRendererCompositor(); |
280 #elif !defined(OS_MACOSX) | 279 #elif !defined(OS_MACOSX) |
281 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 280 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
282 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; | 281 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; |
283 settings.solid_color_scrollbars = true; | 282 settings.solid_color_scrollbars = true; |
284 } | 283 } |
285 if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport) || | 284 if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport) || |
286 cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 285 cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
287 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 286 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
288 settings.solid_color_scrollbar_thickness_dip = 7; | |
289 } | 287 } |
290 #endif | 288 #endif |
291 | 289 |
292 if (!compositor->initialize(settings)) | 290 if (!compositor->initialize(settings)) |
293 return scoped_ptr<RenderWidgetCompositor>(); | 291 return scoped_ptr<RenderWidgetCompositor>(); |
294 | 292 |
295 return compositor.Pass(); | 293 return compositor.Pass(); |
296 } | 294 } |
297 | 295 |
298 RenderWidgetCompositor::RenderWidgetCompositor(RenderWidget* widget, | 296 RenderWidgetCompositor::RenderWidgetCompositor(RenderWidget* widget, |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 592 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
595 } | 593 } |
596 | 594 |
597 scoped_refptr<cc::ContextProvider> | 595 scoped_refptr<cc::ContextProvider> |
598 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 596 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
599 return RenderThreadImpl::current()-> | 597 return RenderThreadImpl::current()-> |
600 OffscreenContextProviderForCompositorThread(); | 598 OffscreenContextProviderForCompositorThread(); |
601 } | 599 } |
602 | 600 |
603 } // namespace content | 601 } // namespace content |
OLD | NEW |