Chromium Code Reviews| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 | 259 |
| 260 settings.strict_layer_property_change_checking = | 260 settings.strict_layer_property_change_checking = |
| 261 cmd->HasSwitch(cc::switches::kStrictLayerPropertyChangeChecking); | 261 cmd->HasSwitch(cc::switches::kStrictLayerPropertyChangeChecking); |
| 262 | 262 |
| 263 settings.use_map_image = cmd->HasSwitch(cc::switches::kUseMapImage); | 263 settings.use_map_image = cmd->HasSwitch(cc::switches::kUseMapImage); |
| 264 | 264 |
| 265 #if defined(OS_ANDROID) | 265 #if defined(OS_ANDROID) |
| 266 // TODO(danakj): Move these to the android code. | 266 // TODO(danakj): Move these to the android code. |
| 267 settings.can_use_lcd_text = false; | 267 settings.can_use_lcd_text = false; |
| 268 settings.max_partial_texture_updates = 0; | 268 settings.max_partial_texture_updates = 0; |
| 269 settings.use_linear_fade_scrollbar_animator = true; | |
| 270 settings.solid_color_scrollbars = true; | |
| 271 settings.solid_color_scrollbar_color = | 269 settings.solid_color_scrollbar_color = |
|
aelias_OOO_until_Jul13
2013/08/14 21:26:08
This will fail to compile. Android WebView needs
wjmaclean
2013/08/15 20:09:40
OK. I've fixed this by re-implementing the --solid
| |
| 272 cmd->HasSwitch(switches::kHideScrollbars) | 270 cmd->HasSwitch(switches::kHideScrollbars) |
| 273 ? SK_ColorTRANSPARENT | 271 ? SK_ColorTRANSPARENT |
| 274 : SkColorSetARGB(128, 128, 128, 128); | 272 : SkColorSetARGB(128, 128, 128, 128); |
| 275 settings.solid_color_scrollbar_thickness_dip = 3; | |
| 276 settings.highp_threshold_min = 2048; | 273 settings.highp_threshold_min = 2048; |
| 277 // Android WebView handles root layer flings itself. | 274 // Android WebView handles root layer flings itself. |
| 278 settings.ignore_root_layer_flings = | 275 settings.ignore_root_layer_flings = |
| 279 widget->UsingSynchronousRendererCompositor(); | 276 widget->UsingSynchronousRendererCompositor(); |
| 280 #elif !defined(OS_MACOSX) | 277 #elif !defined(OS_MACOSX) |
|
wjmaclean
2013/08/14 20:48:27
This should be a separate #if instead of an #elif
wjmaclean
2013/08/15 20:09:40
Done.
| |
| 281 if (cmd->HasSwitch(switches::kEnableOverlayScrollbars)) { | 278 if (cmd->HasSwitch(cc::switches::kEnableOverlayScrollbars)) { |
| 282 settings.use_linear_fade_scrollbar_animator = true; | 279 settings.use_linear_fade_scrollbar_animator = true; |
| 283 settings.solid_color_scrollbars = true; | 280 settings.solid_color_scrollbars = true; |
| 284 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | |
| 285 settings.solid_color_scrollbar_thickness_dip = 3; | |
| 286 } | 281 } |
| 287 #endif | 282 #endif |
| 288 | 283 |
| 289 if (!compositor->initialize(settings)) | 284 if (!compositor->initialize(settings)) |
| 290 return scoped_ptr<RenderWidgetCompositor>(); | 285 return scoped_ptr<RenderWidgetCompositor>(); |
| 291 | 286 |
| 292 return compositor.Pass(); | 287 return compositor.Pass(); |
| 293 } | 288 } |
| 294 | 289 |
| 295 RenderWidgetCompositor::RenderWidgetCompositor(RenderWidget* widget, | 290 RenderWidgetCompositor::RenderWidgetCompositor(RenderWidget* widget, |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 583 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 578 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 584 } | 579 } |
| 585 | 580 |
| 586 scoped_refptr<cc::ContextProvider> | 581 scoped_refptr<cc::ContextProvider> |
| 587 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 582 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 588 return RenderThreadImpl::current()-> | 583 return RenderThreadImpl::current()-> |
| 589 OffscreenContextProviderForCompositorThread(); | 584 OffscreenContextProviderForCompositorThread(); |
| 590 } | 585 } |
| 591 | 586 |
| 592 } // namespace content | 587 } // namespace content |
| OLD | NEW |