| 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 // most long-term caching. | 437 // most long-term caching. |
| 438 settings.decoded_image_cache_budget_bytes = 2 * 1024 * 1024; | 438 settings.decoded_image_cache_budget_bytes = 2 * 1024 * 1024; |
| 439 } | 439 } |
| 440 | 440 |
| 441 // TODO(danakj): Only do this on low end devices. | 441 // TODO(danakj): Only do this on low end devices. |
| 442 settings.create_low_res_tiling = true; | 442 settings.create_low_res_tiling = true; |
| 443 #else // defined(OS_ANDROID) | 443 #else // defined(OS_ANDROID) |
| 444 #if !defined(OS_MACOSX) | 444 #if !defined(OS_MACOSX) |
| 445 if (ui::IsOverlayScrollbarEnabled()) { | 445 if (ui::IsOverlayScrollbarEnabled()) { |
| 446 settings.scrollbar_animator = cc::LayerTreeSettings::AURA_OVERLAY; | 446 settings.scrollbar_animator = cc::LayerTreeSettings::AURA_OVERLAY; |
| 447 settings.scrollbar_show_delay = ui::kOverlayScrollbarShowDelay; | 447 settings.scrollbar_fade_in_delay = ui::kOverlayScrollbarFadeInDelay; |
| 448 settings.scrollbar_fade_out_delay = ui::kOverlayScrollbarFadeOutDelay; | 448 settings.scrollbar_fade_out_delay = ui::kOverlayScrollbarFadeOutDelay; |
| 449 settings.scrollbar_fade_out_resize_delay = | 449 settings.scrollbar_fade_out_resize_delay = |
| 450 ui::kOverlayScrollbarFadeOutDelay; | 450 ui::kOverlayScrollbarFadeOutDelay; |
| 451 settings.scrollbar_fade_out_duration = ui::kOverlayScrollbarFadeOutDuration; | 451 settings.scrollbar_fade_duration = ui::kOverlayScrollbarFadeDuration; |
| 452 settings.scrollbar_thinning_duration = | 452 settings.scrollbar_thinning_duration = |
| 453 ui::kOverlayScrollbarThinningDuration; | 453 ui::kOverlayScrollbarThinningDuration; |
| 454 } else { | 454 } else { |
| 455 // TODO(bokan): This section is probably unneeded? We don't use scrollbar | 455 // TODO(bokan): This section is probably unneeded? We don't use scrollbar |
| 456 // animations for non overlay scrollbars. | 456 // animations for non overlay scrollbars. |
| 457 settings.scrollbar_animator = cc::LayerTreeSettings::ANDROID_OVERLAY; | 457 settings.scrollbar_animator = cc::LayerTreeSettings::ANDROID_OVERLAY; |
| 458 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 458 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 459 settings.scrollbar_fade_out_delay = base::TimeDelta::FromMilliseconds(500); | 459 settings.scrollbar_fade_out_delay = base::TimeDelta::FromMilliseconds(500); |
| 460 settings.scrollbar_fade_out_resize_delay = | 460 settings.scrollbar_fade_out_resize_delay = |
| 461 base::TimeDelta::FromMilliseconds(500); | 461 base::TimeDelta::FromMilliseconds(500); |
| 462 settings.scrollbar_fade_out_duration = | 462 settings.scrollbar_fade_duration = base::TimeDelta::FromMilliseconds(300); |
| 463 base::TimeDelta::FromMilliseconds(300); | |
| 464 } | 463 } |
| 465 #endif // !defined(OS_MACOSX) | 464 #endif // !defined(OS_MACOSX) |
| 466 | 465 |
| 467 // On desktop, if there's over 4GB of memory on the machine, increase the | 466 // On desktop, if there's over 4GB of memory on the machine, increase the |
| 468 // image decode budget to 256MB for both gpu and software. | 467 // image decode budget to 256MB for both gpu and software. |
| 469 const int kImageDecodeMemoryThresholdMB = 4 * 1024; | 468 const int kImageDecodeMemoryThresholdMB = 4 * 1024; |
| 470 if (base::SysInfo::AmountOfPhysicalMemoryMB() >= | 469 if (base::SysInfo::AmountOfPhysicalMemoryMB() >= |
| 471 kImageDecodeMemoryThresholdMB) { | 470 kImageDecodeMemoryThresholdMB) { |
| 472 settings.decoded_image_cache_budget_bytes = 256 * 1024 * 1024; | 471 settings.decoded_image_cache_budget_bytes = 256 * 1024 * 1024; |
| 473 settings.decoded_image_working_set_budget_bytes = 256 * 1024 * 1024; | 472 settings.decoded_image_working_set_budget_bytes = 256 * 1024 * 1024; |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 void RenderWidgetCompositor::SetContentSourceId(uint32_t id) { | 1149 void RenderWidgetCompositor::SetContentSourceId(uint32_t id) { |
| 1151 layer_tree_host_->SetContentSourceId(id); | 1150 layer_tree_host_->SetContentSourceId(id); |
| 1152 } | 1151 } |
| 1153 | 1152 |
| 1154 void RenderWidgetCompositor::SetLocalSurfaceId( | 1153 void RenderWidgetCompositor::SetLocalSurfaceId( |
| 1155 const cc::LocalSurfaceId& local_surface_id) { | 1154 const cc::LocalSurfaceId& local_surface_id) { |
| 1156 layer_tree_host_->SetLocalSurfaceId(local_surface_id); | 1155 layer_tree_host_->SetLocalSurfaceId(local_surface_id); |
| 1157 } | 1156 } |
| 1158 | 1157 |
| 1159 } // namespace content | 1158 } // namespace content |
| OLD | NEW |