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 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "gpu/command_buffer/service/gpu_switches.h" | 52 #include "gpu/command_buffer/service/gpu_switches.h" |
53 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" | 53 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" |
54 #include "third_party/WebKit/public/platform/WebCompositorMutatorClient.h" | 54 #include "third_party/WebKit/public/platform/WebCompositorMutatorClient.h" |
55 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" | 55 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" |
56 #include "third_party/WebKit/public/platform/WebSize.h" | 56 #include "third_party/WebKit/public/platform/WebSize.h" |
57 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 57 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
58 #include "third_party/WebKit/public/web/WebKit.h" | 58 #include "third_party/WebKit/public/web/WebKit.h" |
59 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 59 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
60 #include "third_party/WebKit/public/web/WebSelection.h" | 60 #include "third_party/WebKit/public/web/WebSelection.h" |
61 #include "ui/gl/gl_switches.h" | 61 #include "ui/gl/gl_switches.h" |
| 62 #include "ui/native_theme/material_design_constants.h" |
62 #include "ui/native_theme/native_theme_switches.h" | 63 #include "ui/native_theme/native_theme_switches.h" |
63 | 64 |
64 #if defined(OS_ANDROID) | 65 #if defined(OS_ANDROID) |
65 #include "base/android/build_info.h" | 66 #include "base/android/build_info.h" |
66 #include "ui/gfx/android/device_display_info.h" | 67 #include "ui/gfx/android/device_display_info.h" |
67 #endif | 68 #endif |
68 | 69 |
69 namespace base { | 70 namespace base { |
70 class Value; | 71 class Value; |
71 } | 72 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // Webview does not own the surface so should not clear it. | 414 // Webview does not own the surface so should not clear it. |
414 settings.renderer_settings.should_clear_root_render_pass = | 415 settings.renderer_settings.should_clear_root_render_pass = |
415 !using_synchronous_compositor; | 416 !using_synchronous_compositor; |
416 | 417 |
417 // TODO(danakj): Only do this on low end devices. | 418 // TODO(danakj): Only do this on low end devices. |
418 settings.create_low_res_tiling = true; | 419 settings.create_low_res_tiling = true; |
419 #else // defined(OS_ANDROID) | 420 #else // defined(OS_ANDROID) |
420 #if !defined(OS_MACOSX) | 421 #if !defined(OS_MACOSX) |
421 if (ui::IsOverlayScrollbarEnabled()) { | 422 if (ui::IsOverlayScrollbarEnabled()) { |
422 settings.scrollbar_animator = cc::LayerTreeSettings::THINNING; | 423 settings.scrollbar_animator = cc::LayerTreeSettings::THINNING; |
423 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 424 settings.scrollbar_fade_delay_ms = ui::kMDScrollbarFadeOutDelayMs; |
| 425 settings.scrollbar_fade_resize_delay_ms = ui::kMDScrollbarFadeOutDelayMs; |
| 426 settings.scrollbar_fade_duration_ms = ui::kMDScrollbarFadeOutDurationMs; |
| 427 settings.scrollbar_thinning_duration_ms = |
| 428 ui::kMDScrollbarThinningDurationMs; |
424 } else { | 429 } else { |
| 430 // TODO(bokan): This section is probably unneeded? We don't use scrollbar |
| 431 // animations for non overlay scrollbars. |
425 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; | 432 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; |
426 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 433 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
| 434 settings.scrollbar_fade_delay_ms = 500; |
| 435 settings.scrollbar_fade_resize_delay_ms = 500; |
| 436 settings.scrollbar_fade_duration_ms = 300; |
427 } | 437 } |
428 settings.scrollbar_fade_delay_ms = 500; | |
429 settings.scrollbar_fade_resize_delay_ms = 500; | |
430 settings.scrollbar_fade_duration_ms = 300; | |
431 #endif // !defined(OS_MACOSX) | 438 #endif // !defined(OS_MACOSX) |
432 | 439 |
433 // On desktop, if there's over 4GB of memory on the machine, increase the | 440 // On desktop, if there's over 4GB of memory on the machine, increase the |
434 // image decode budget to 256MB for both gpu and software. | 441 // image decode budget to 256MB for both gpu and software. |
435 const int kImageDecodeMemoryThresholdMB = 4 * 1024; | 442 const int kImageDecodeMemoryThresholdMB = 4 * 1024; |
436 if (base::SysInfo::AmountOfPhysicalMemoryMB() >= | 443 if (base::SysInfo::AmountOfPhysicalMemoryMB() >= |
437 kImageDecodeMemoryThresholdMB) { | 444 kImageDecodeMemoryThresholdMB) { |
438 settings.gpu_decoded_image_budget_bytes = 256 * 1024 * 1024; | 445 settings.gpu_decoded_image_budget_bytes = 256 * 1024 * 1024; |
439 settings.software_decoded_image_budget_bytes = 256 * 1024 * 1024; | 446 settings.software_decoded_image_budget_bytes = 256 * 1024 * 1024; |
440 } else { | 447 } else { |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 float device_scale) { | 1124 float device_scale) { |
1118 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); | 1125 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); |
1119 } | 1126 } |
1120 | 1127 |
1121 void RenderWidgetCompositor::SetDeviceColorSpace( | 1128 void RenderWidgetCompositor::SetDeviceColorSpace( |
1122 const gfx::ColorSpace& color_space) { | 1129 const gfx::ColorSpace& color_space) { |
1123 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); | 1130 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); |
1124 } | 1131 } |
1125 | 1132 |
1126 } // namespace content | 1133 } // namespace content |
OLD | NEW |