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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 settings.report_overscroll_only_for_scrollable_axes = | 353 settings.report_overscroll_only_for_scrollable_axes = |
354 !synchronous_compositor_factory; | 354 !synchronous_compositor_factory; |
355 settings.max_partial_texture_updates = 0; | 355 settings.max_partial_texture_updates = 0; |
356 if (synchronous_compositor_factory) { | 356 if (synchronous_compositor_factory) { |
357 // Android WebView uses system scrollbars, so make ours invisible. | 357 // Android WebView uses system scrollbars, so make ours invisible. |
358 settings.scrollbar_animator = cc::LayerTreeSettings::NoAnimator; | 358 settings.scrollbar_animator = cc::LayerTreeSettings::NoAnimator; |
359 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; | 359 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; |
360 } else { | 360 } else { |
361 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 361 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
362 settings.scrollbar_fade_delay_ms = 300; | 362 settings.scrollbar_fade_delay_ms = 300; |
| 363 settings.scrollbar_fade_resize_delay_ms = 2000; |
363 settings.scrollbar_fade_duration_ms = 300; | 364 settings.scrollbar_fade_duration_ms = 300; |
364 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 365 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
365 } | 366 } |
366 settings.highp_threshold_min = 2048; | 367 settings.highp_threshold_min = 2048; |
367 // Android WebView handles root layer flings itself. | 368 // Android WebView handles root layer flings itself. |
368 settings.ignore_root_layer_flings = | 369 settings.ignore_root_layer_flings = |
369 synchronous_compositor_factory; | 370 synchronous_compositor_factory; |
370 // Memory policy on Android WebView does not depend on whether device is | 371 // Memory policy on Android WebView does not depend on whether device is |
371 // low end, so always use default policy. | 372 // low end, so always use default policy. |
372 bool is_low_end_device = | 373 bool is_low_end_device = |
(...skipping 24 matching lines...) Expand all Loading... |
397 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; | 398 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; |
398 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 399 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
399 } else if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport)) { | 400 } else if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport)) { |
400 // use_pinch_zoom_scrollbars is only true on desktop when non-overlay | 401 // use_pinch_zoom_scrollbars is only true on desktop when non-overlay |
401 // scrollbars are in use. | 402 // scrollbars are in use. |
402 settings.use_pinch_zoom_scrollbars = true; | 403 settings.use_pinch_zoom_scrollbars = true; |
403 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 404 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
404 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 405 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
405 } | 406 } |
406 settings.scrollbar_fade_delay_ms = 500; | 407 settings.scrollbar_fade_delay_ms = 500; |
| 408 settings.scrollbar_fade_resize_delay_ms = 500; |
407 settings.scrollbar_fade_duration_ms = 300; | 409 settings.scrollbar_fade_duration_ms = 300; |
408 #endif | 410 #endif |
409 | 411 |
410 if (cmd->HasSwitch(switches::kEnableLowResTiling)) | 412 if (cmd->HasSwitch(switches::kEnableLowResTiling)) |
411 settings.create_low_res_tiling = true; | 413 settings.create_low_res_tiling = true; |
412 if (cmd->HasSwitch(switches::kDisableLowResTiling)) | 414 if (cmd->HasSwitch(switches::kDisableLowResTiling)) |
413 settings.create_low_res_tiling = false; | 415 settings.create_low_res_tiling = false; |
414 | 416 |
415 compositor->Initialize(settings); | 417 compositor->Initialize(settings); |
416 | 418 |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 widget_->OnSwapBuffersAborted(); | 870 widget_->OnSwapBuffersAborted(); |
869 } | 871 } |
870 | 872 |
871 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 873 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
872 cc::ContextProvider* provider = | 874 cc::ContextProvider* provider = |
873 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 875 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
874 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 876 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
875 } | 877 } |
876 | 878 |
877 } // namespace content | 879 } // namespace content |
OLD | NEW |