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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 | 381 |
| 382 settings.using_synchronous_renderer_compositor = using_synchronous_compositor; | 382 settings.using_synchronous_renderer_compositor = using_synchronous_compositor; |
| 383 if (using_synchronous_compositor) { | 383 if (using_synchronous_compositor) { |
| 384 // Android WebView uses system scrollbars, so make ours invisible. | 384 // Android WebView uses system scrollbars, so make ours invisible. |
| 385 // http://crbug.com/677348: This can't be done using hide_scrollbars | 385 // http://crbug.com/677348: This can't be done using hide_scrollbars |
| 386 // setting because supporting -webkit custom scrollbars is still desired | 386 // setting because supporting -webkit custom scrollbars is still desired |
| 387 // on sublayers. | 387 // on sublayers. |
| 388 settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR; | 388 settings.scrollbar_animator = cc::LayerTreeSettings::NO_ANIMATOR; |
| 389 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; | 389 settings.solid_color_scrollbar_color = SK_ColorTRANSPARENT; |
| 390 } else { | 390 } else { |
| 391 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; | 391 settings.scrollbar_animator = cc::LayerTreeSettings::ANDROID_OVERLAY; |
| 392 settings.scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(300); | 392 settings.scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(300); |
| 393 settings.scrollbar_fade_resize_delay = | 393 settings.scrollbar_fade_resize_delay = |
| 394 base::TimeDelta::FromMilliseconds(2000); | 394 base::TimeDelta::FromMilliseconds(2000); |
| 395 settings.scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300); | 395 settings.scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300); |
| 396 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 396 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 397 } | 397 } |
| 398 settings.renderer_settings.highp_threshold_min = 2048; | 398 settings.renderer_settings.highp_threshold_min = 2048; |
| 399 // Android WebView handles root layer flings itself. | 399 // Android WebView handles root layer flings itself. |
| 400 settings.ignore_root_layer_flings = using_synchronous_compositor; | 400 settings.ignore_root_layer_flings = using_synchronous_compositor; |
| 401 // Memory policy on Android WebView does not depend on whether device is | 401 // Memory policy on Android WebView does not depend on whether device is |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 420 } | 420 } |
| 421 // Webview does not own the surface so should not clear it. | 421 // Webview does not own the surface so should not clear it. |
| 422 settings.renderer_settings.should_clear_root_render_pass = | 422 settings.renderer_settings.should_clear_root_render_pass = |
| 423 !using_synchronous_compositor; | 423 !using_synchronous_compositor; |
| 424 | 424 |
| 425 // TODO(danakj): Only do this on low end devices. | 425 // TODO(danakj): Only do this on low end devices. |
| 426 settings.create_low_res_tiling = true; | 426 settings.create_low_res_tiling = true; |
| 427 #else // defined(OS_ANDROID) | 427 #else // defined(OS_ANDROID) |
| 428 #if !defined(OS_MACOSX) | 428 #if !defined(OS_MACOSX) |
| 429 if (ui::IsOverlayScrollbarEnabled()) { | 429 if (ui::IsOverlayScrollbarEnabled()) { |
| 430 settings.scrollbar_animator = cc::LayerTreeSettings::THINNING; | 430 settings.scrollbar_animator = cc::LayerTreeSettings::AURA_OVERLAY; |
| 431 settings.scrollbar_fade_delay = ui::kOverlayScrollbarFadeOutDelay; | 431 settings.scrollbar_fade_delay = ui::kOverlayScrollbarFadeOutDelay; |
| 432 settings.scrollbar_fade_resize_delay = | 432 settings.scrollbar_fade_resize_delay = |
| 433 ui::kOverlayScrollbarFadeOutDelay; | 433 ui::kOverlayScrollbarFadeOutDelay; |
| 434 settings.scrollbar_fade_duration = | 434 settings.scrollbar_fade_duration = |
| 435 ui::kOverlayScrollbarFadeOutDuration; | 435 ui::kOverlayScrollbarFadeOutDuration; |
| 436 settings.scrollbar_thinning_duration = | 436 settings.scrollbar_thinning_duration = |
| 437 ui::kOverlayScrollbarThinningDuration; | 437 ui::kOverlayScrollbarThinningDuration; |
| 438 } else { | 438 } else { |
| 439 // TODO(bokan): This section is probably unneeded? We don't use scrollbar | 439 // TODO(bokan): This section is probably unneeded? We don't use scrollbar |
| 440 // animations for non overlay scrollbars. | 440 // animations for non overlay scrollbars. |
| 441 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; | 441 settings.scrollbar_animator = cc::LayerTreeSettings::ANDROID_OVERLAY; |
|
ncarter (slow)
2017/02/17 20:47:17
As a result of the renaming, this looks weirder th
chaopeng
2017/02/17 21:35:58
We have a plan to fix Mac scrollbar and this TODO
bokan
2017/02/21 15:49:56
This is already for non-Mac. I think we could just
| |
| 442 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 442 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 443 settings.scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(500); | 443 settings.scrollbar_fade_delay = base::TimeDelta::FromMilliseconds(500); |
| 444 settings.scrollbar_fade_resize_delay = | 444 settings.scrollbar_fade_resize_delay = |
| 445 base::TimeDelta::FromMilliseconds(500); | 445 base::TimeDelta::FromMilliseconds(500); |
| 446 settings.scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300); | 446 settings.scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300); |
| 447 } | 447 } |
| 448 #endif // !defined(OS_MACOSX) | 448 #endif // !defined(OS_MACOSX) |
| 449 | 449 |
| 450 // On desktop, if there's over 4GB of memory on the machine, increase the | 450 // On desktop, if there's over 4GB of memory on the machine, increase the |
| 451 // image decode budget to 256MB for both gpu and software. | 451 // image decode budget to 256MB for both gpu and software. |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1121 void RenderWidgetCompositor::SetDeviceColorSpace( | 1121 void RenderWidgetCompositor::SetDeviceColorSpace( |
| 1122 const gfx::ColorSpace& color_space) { | 1122 const gfx::ColorSpace& color_space) { |
| 1123 layer_tree_host_->SetDeviceColorSpace(color_space); | 1123 layer_tree_host_->SetDeviceColorSpace(color_space); |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 void RenderWidgetCompositor::SetIsForOopif(bool is_for_oopif) { | 1126 void RenderWidgetCompositor::SetIsForOopif(bool is_for_oopif) { |
| 1127 is_for_oopif_ = is_for_oopif; | 1127 is_for_oopif_ = is_for_oopif; |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 } // namespace content | 1130 } // namespace content |
| OLD | NEW |