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 <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // On low-end we want to be very carefull about killing other | 272 // On low-end we want to be very carefull about killing other |
273 // apps. So initially we use 50% more memory to avoid flickering | 273 // apps. So initially we use 50% more memory to avoid flickering |
274 // or raster-on-demand. | 274 // or raster-on-demand. |
275 settings.max_memory_for_prepaint_percentage = 67; | 275 settings.max_memory_for_prepaint_percentage = 67; |
276 } else { | 276 } else { |
277 // On other devices we have increased memory excessively to avoid | 277 // On other devices we have increased memory excessively to avoid |
278 // raster-on-demand already, so now we reserve 50% _only_ to avoid | 278 // raster-on-demand already, so now we reserve 50% _only_ to avoid |
279 // raster-on-demand, and use 50% of the memory otherwise. | 279 // raster-on-demand, and use 50% of the memory otherwise. |
280 settings.max_memory_for_prepaint_percentage = 50; | 280 settings.max_memory_for_prepaint_percentage = 50; |
281 } | 281 } |
| 282 // Webview does not own the surface so should not clear it. |
| 283 settings.should_clear_root_render_pass = |
| 284 !widget->UsingSynchronousRendererCompositor(); |
282 | 285 |
283 #elif !defined(OS_MACOSX) | 286 #elif !defined(OS_MACOSX) |
284 if (ui::IsOverlayScrollbarEnabled()) { | 287 if (ui::IsOverlayScrollbarEnabled()) { |
285 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; | 288 settings.scrollbar_animator = cc::LayerTreeSettings::Thinning; |
286 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 289 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
287 } else if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport)) { | 290 } else if (cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport)) { |
288 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 291 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
289 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); | 292 settings.solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
290 } | 293 } |
291 #endif | 294 #endif |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 widget_->OnSwapBuffersAborted(); | 649 widget_->OnSwapBuffersAborted(); |
647 } | 650 } |
648 | 651 |
649 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 652 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
650 cc::ContextProvider* provider = | 653 cc::ContextProvider* provider = |
651 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 654 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
652 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 655 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
653 } | 656 } |
654 | 657 |
655 } // namespace content | 658 } // namespace content |
OLD | NEW |