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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 settings.report_overscroll_only_for_scrollable_axes = | 355 settings.report_overscroll_only_for_scrollable_axes = |
| 356 !synchronous_compositor_factory; | 356 !synchronous_compositor_factory; |
| 357 settings.max_partial_texture_updates = 0; | 357 settings.max_partial_texture_updates = 0; |
| 358 if (synchronous_compositor_factory) { | 358 if (synchronous_compositor_factory) { |
| 359 // Android WebView uses system scrollbars, so make ours invisible. | 359 // Android WebView uses system scrollbars, so make ours invisible. |
| 360 settings.scrollbar_animator = cc::LayerTreeSettings::NoAnimator; | 360 settings.scrollbar_animator = cc::LayerTreeSettings::NoAnimator; |
| 361 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; | 361 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; |
| 362 } else { | 362 } else { |
| 363 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 363 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
| 364 settings.scrollbar_fade_delay_ms = 300; | 364 settings.scrollbar_fade_delay_ms = 300; |
| 365 settings.scrollbar_fade_resize_delay_ms = 2000; | |
| 365 settings.scrollbar_fade_duration_ms = 300; | 366 settings.scrollbar_fade_duration_ms = 300; |
| 366 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 367 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 367 } | 368 } |
| 368 settings.highp_threshold_min = 2048; | 369 settings.highp_threshold_min = 2048; |
| 369 // Android WebView handles root layer flings itself. | 370 // Android WebView handles root layer flings itself. |
| 370 settings.ignore_root_layer_flings = | 371 settings.ignore_root_layer_flings = |
| 371 synchronous_compositor_factory; | 372 synchronous_compositor_factory; |
| 372 // Memory policy on Android WebView does not depend on whether device is | 373 // Memory policy on Android WebView does not depend on whether device is |
| 373 // low end, so always use default policy. | 374 // low end, so always use default policy. |
| 374 bool is_low_end_device = | 375 bool is_low_end_device = |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 399 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; | 400 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; |
| 400 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 401 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 401 } else if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport)) { | 402 } else if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport)) { |
| 402 // use_pinch_zoom_scrollbars is only true on desktop when non-overlay | 403 // use_pinch_zoom_scrollbars is only true on desktop when non-overlay |
| 403 // scrollbars are in use. | 404 // scrollbars are in use. |
| 404 settings.use_pinch_zoom_scrollbars = true; | 405 settings.use_pinch_zoom_scrollbars = true; |
| 405 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 406 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
| 406 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 407 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 407 } | 408 } |
| 408 settings.scrollbar_fade_delay_ms = 500; | 409 settings.scrollbar_fade_delay_ms = 500; |
| 410 settings.scrollbar_fade_resize_delay_ms = 2000; | |
|
aelias_OOO_until_Jul13
2014/10/01 18:41:26
Please set this to 500 since the page-load fade-sp
MuVen
2014/10/02 08:42:47
Done.
| |
| 409 settings.scrollbar_fade_duration_ms = 300; | 411 settings.scrollbar_fade_duration_ms = 300; |
| 410 #endif | 412 #endif |
| 411 | 413 |
| 412 if (cmd->HasSwitch(switches::kEnableLowResTiling)) | 414 if (cmd->HasSwitch(switches::kEnableLowResTiling)) |
| 413 settings.create_low_res_tiling = true; | 415 settings.create_low_res_tiling = true; |
| 414 if (cmd->HasSwitch(switches::kDisableLowResTiling)) | 416 if (cmd->HasSwitch(switches::kDisableLowResTiling)) |
| 415 settings.create_low_res_tiling = false; | 417 settings.create_low_res_tiling = false; |
| 416 | 418 |
| 417 compositor->Initialize(settings); | 419 compositor->Initialize(settings); |
| 418 | 420 |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 849 widget_->OnSwapBuffersAborted(); | 851 widget_->OnSwapBuffersAborted(); |
| 850 } | 852 } |
| 851 | 853 |
| 852 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 854 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 853 cc::ContextProvider* provider = | 855 cc::ContextProvider* provider = |
| 854 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 856 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 855 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 857 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 856 } | 858 } |
| 857 | 859 |
| 858 } // namespace content | 860 } // namespace content |
| OLD | NEW |