| 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 #if defined(OS_ANDROID) |
| 11 #include "base/android/sys_utils.h" |
| 12 #endif |
| 13 |
| 10 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 15 #include "base/logging.h" |
| 12 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 14 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 15 #include "cc/base/switches.h" | 19 #include "cc/base/switches.h" |
| 16 #include "cc/debug/layer_tree_debug_state.h" | 20 #include "cc/debug/layer_tree_debug_state.h" |
| 17 #include "cc/layers/layer.h" | 21 #include "cc/layers/layer.h" |
| 18 #include "cc/trees/layer_tree_host.h" | 22 #include "cc/trees/layer_tree_host.h" |
| 19 #include "content/common/gpu/client/context_provider_command_buffer.h" | 23 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 settings.solid_color_scrollbars = true; | 274 settings.solid_color_scrollbars = true; |
| 271 settings.solid_color_scrollbar_color = | 275 settings.solid_color_scrollbar_color = |
| 272 cmd->HasSwitch(switches::kHideScrollbars) | 276 cmd->HasSwitch(switches::kHideScrollbars) |
| 273 ? SK_ColorTRANSPARENT | 277 ? SK_ColorTRANSPARENT |
| 274 : SkColorSetARGB(128, 128, 128, 128); | 278 : SkColorSetARGB(128, 128, 128, 128); |
| 275 settings.solid_color_scrollbar_thickness_dip = 3; | 279 settings.solid_color_scrollbar_thickness_dip = 3; |
| 276 settings.highp_threshold_min = 2048; | 280 settings.highp_threshold_min = 2048; |
| 277 // Android WebView handles root layer flings itself. | 281 // Android WebView handles root layer flings itself. |
| 278 settings.ignore_root_layer_flings = | 282 settings.ignore_root_layer_flings = |
| 279 widget->UsingSynchronousRendererCompositor(); | 283 widget->UsingSynchronousRendererCompositor(); |
| 284 // RGBA_4444 textures are only enabled for low end devices |
| 285 // and are disabled for Android WebView as it doesn't support the format. |
| 286 settings.use_rgba_4444_textures = |
| 287 base::android::SysUtils::IsLowEndDevice() && |
| 288 !widget->UsingSynchronousRendererCompositor() && |
| 289 !cmd->HasSwitch(cc::switches::kDisable4444Textures); |
| 280 #elif !defined(OS_MACOSX) | 290 #elif !defined(OS_MACOSX) |
| 281 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 291 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
| 282 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 292 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
| 283 settings.solid_color_scrollbars = true; | 293 settings.solid_color_scrollbars = true; |
| 284 } | 294 } |
| 285 if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport) || | 295 if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport) || |
| 286 cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 296 cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
| 287 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 297 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 288 settings.solid_color_scrollbar_thickness_dip = 7; | 298 settings.solid_color_scrollbar_thickness_dip = 7; |
| 289 } | 299 } |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 604 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 595 } | 605 } |
| 596 | 606 |
| 597 scoped_refptr<cc::ContextProvider> | 607 scoped_refptr<cc::ContextProvider> |
| 598 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 608 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 599 return RenderThreadImpl::current()-> | 609 return RenderThreadImpl::current()-> |
| 600 OffscreenContextProviderForCompositorThread(); | 610 OffscreenContextProviderForCompositorThread(); |
| 601 } | 611 } |
| 602 | 612 |
| 603 } // namespace content | 613 } // namespace content |
| OLD | NEW |