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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } else { | 420 } else { |
421 // On other devices we have increased memory excessively to avoid | 421 // On other devices we have increased memory excessively to avoid |
422 // raster-on-demand already, so now we reserve 50% _only_ to avoid | 422 // raster-on-demand already, so now we reserve 50% _only_ to avoid |
423 // raster-on-demand, and use 50% of the memory otherwise. | 423 // raster-on-demand, and use 50% of the memory otherwise. |
424 settings.max_memory_for_prepaint_percentage = 50; | 424 settings.max_memory_for_prepaint_percentage = 50; |
425 } | 425 } |
426 // Webview does not own the surface so should not clear it. | 426 // Webview does not own the surface so should not clear it. |
427 settings.renderer_settings.should_clear_root_render_pass = | 427 settings.renderer_settings.should_clear_root_render_pass = |
428 !using_synchronous_compositor; | 428 !using_synchronous_compositor; |
429 | 429 |
430 // TODO(danakj): Only do this on low end devices. | 430 if (base::SysInfo::IsLowEndDevice()) |
431 settings.create_low_res_tiling = true; | 431 settings.create_low_res_tiling = true; |
432 #else // defined(OS_ANDROID) | 432 #else // defined(OS_ANDROID) |
433 #if !defined(OS_MACOSX) | 433 #if !defined(OS_MACOSX) |
434 if (ui::IsOverlayScrollbarEnabled()) { | 434 if (ui::IsOverlayScrollbarEnabled()) { |
435 settings.scrollbar_animator = cc::LayerTreeSettings::AURA_OVERLAY; | 435 settings.scrollbar_animator = cc::LayerTreeSettings::AURA_OVERLAY; |
436 settings.scrollbar_show_delay = ui::kOverlayScrollbarShowDelay; | 436 settings.scrollbar_show_delay = ui::kOverlayScrollbarShowDelay; |
437 settings.scrollbar_fade_out_delay = ui::kOverlayScrollbarFadeOutDelay; | 437 settings.scrollbar_fade_out_delay = ui::kOverlayScrollbarFadeOutDelay; |
438 settings.scrollbar_fade_out_resize_delay = | 438 settings.scrollbar_fade_out_resize_delay = |
439 ui::kOverlayScrollbarFadeOutDelay; | 439 ui::kOverlayScrollbarFadeOutDelay; |
440 settings.scrollbar_fade_out_duration = ui::kOverlayScrollbarFadeOutDuration; | 440 settings.scrollbar_fade_out_duration = ui::kOverlayScrollbarFadeOutDuration; |
441 settings.scrollbar_thinning_duration = | 441 settings.scrollbar_thinning_duration = |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 void RenderWidgetCompositor::SetContentSourceId(uint32_t id) { | 1145 void RenderWidgetCompositor::SetContentSourceId(uint32_t id) { |
1146 layer_tree_host_->SetContentSourceId(id); | 1146 layer_tree_host_->SetContentSourceId(id); |
1147 } | 1147 } |
1148 | 1148 |
1149 void RenderWidgetCompositor::SetLocalSurfaceId( | 1149 void RenderWidgetCompositor::SetLocalSurfaceId( |
1150 const cc::LocalSurfaceId& local_surface_id) { | 1150 const cc::LocalSurfaceId& local_surface_id) { |
1151 layer_tree_host_->SetLocalSurfaceId(local_surface_id); | 1151 layer_tree_host_->SetLocalSurfaceId(local_surface_id); |
1152 } | 1152 } |
1153 | 1153 |
1154 } // namespace content | 1154 } // namespace content |
OLD | NEW |