| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 273 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
| 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.highp_threshold_min = 2048; | 279 settings.highp_threshold_min = 2048; |
| 276 // Android WebView handles root layer flings itself. | 280 // Android WebView handles root layer flings itself. |
| 277 settings.ignore_root_layer_flings = | 281 settings.ignore_root_layer_flings = |
| 278 widget->UsingSynchronousRendererCompositor(); | 282 widget->UsingSynchronousRendererCompositor(); |
| 283 // RGBA_4444 textures are only enabled for low end devices |
| 284 // and are disabled for Android WebView as it doesn't support the format. |
| 285 settings.use_rgba_4444_textures = |
| 286 base::android::SysUtils::IsLowEndDevice() && |
| 287 !widget->UsingSynchronousRendererCompositor() && |
| 288 !cmd->HasSwitch(cc::switches::kDisable4444Textures); |
| 279 #elif !defined(OS_MACOSX) | 289 #elif !defined(OS_MACOSX) |
| 280 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 290 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
| 281 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; | 291 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; |
| 282 settings.solid_color_scrollbars = true; | 292 settings.solid_color_scrollbars = true; |
| 283 } | 293 } |
| 284 if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport) || | 294 if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport) || |
| 285 cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 295 cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { |
| 286 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 296 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 287 } | 297 } |
| 288 #endif | 298 #endif |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 623 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 614 } | 624 } |
| 615 | 625 |
| 616 scoped_refptr<cc::ContextProvider> | 626 scoped_refptr<cc::ContextProvider> |
| 617 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 627 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 618 return RenderThreadImpl::current()-> | 628 return RenderThreadImpl::current()-> |
| 619 OffscreenContextProviderForCompositorThread(); | 629 OffscreenContextProviderForCompositorThread(); |
| 620 } | 630 } |
| 621 | 631 |
| 622 } // namespace content | 632 } // namespace content |
| OLD | NEW |