Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2421913002: Change Aura overlay scrollbars from solid color to painted scrollbars. (Closed)
Patch Set: Address pkasting@'s feedback Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/native_theme_switches.h" 62 #include "ui/native_theme/native_theme_switches.h"
63 #include "ui/native_theme/overlay_scrollbar_constants_aura.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 }
72 73
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::kOverlayScrollbarFadeOutDelayMs;
425 settings.scrollbar_fade_resize_delay_ms =
426 ui::kOverlayScrollbarFadeOutDelayMs;
427 settings.scrollbar_fade_duration_ms =
428 ui::kOverlayScrollbarFadeOutDurationMs;
429 settings.scrollbar_thinning_duration_ms =
430 ui::kOverlayScrollbarThinningDurationMs;
424 } else { 431 } else {
432 // TODO(bokan): This section is probably unneeded? We don't use scrollbar
433 // animations for non overlay scrollbars.
425 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE; 434 settings.scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
426 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); 435 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
436 settings.scrollbar_fade_delay_ms = 500;
437 settings.scrollbar_fade_resize_delay_ms = 500;
438 settings.scrollbar_fade_duration_ms = 300;
427 } 439 }
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) 440 #endif // !defined(OS_MACOSX)
432 441
433 // On desktop, if there's over 4GB of memory on the machine, increase the 442 // 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. 443 // image decode budget to 256MB for both gpu and software.
435 const int kImageDecodeMemoryThresholdMB = 4 * 1024; 444 const int kImageDecodeMemoryThresholdMB = 4 * 1024;
436 if (base::SysInfo::AmountOfPhysicalMemoryMB() >= 445 if (base::SysInfo::AmountOfPhysicalMemoryMB() >=
437 kImageDecodeMemoryThresholdMB) { 446 kImageDecodeMemoryThresholdMB) {
438 settings.gpu_decoded_image_budget_bytes = 256 * 1024 * 1024; 447 settings.gpu_decoded_image_budget_bytes = 256 * 1024 * 1024;
439 settings.software_decoded_image_budget_bytes = 256 * 1024 * 1024; 448 settings.software_decoded_image_budget_bytes = 256 * 1024 * 1024;
440 } else { 449 } else {
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 float device_scale) { 1126 float device_scale) {
1118 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); 1127 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale);
1119 } 1128 }
1120 1129
1121 void RenderWidgetCompositor::SetDeviceColorSpace( 1130 void RenderWidgetCompositor::SetDeviceColorSpace(
1122 const gfx::ColorSpace& color_space) { 1131 const gfx::ColorSpace& color_space) {
1123 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); 1132 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space);
1124 } 1133 }
1125 1134
1126 } // namespace content 1135 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698