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

Unified Diff: content/renderer/render_widget.cc

Issue 22900018: cc: Set the mapped memory reclaim limit for the renderer compositor on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« cc/trees/layer_tree_host_impl.cc ('K') | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 53b8839462b97f2a6fd47a3cf42e0887bef3b4d8..550600fd11813545dcd9479df08d1581e8652bcb 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -640,7 +640,8 @@ bool RenderWidget::ForceCompositingModeEnabled() {
return false;
}
-scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
+scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
+ bool fallback, size_t max_bytes_pending_upload) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
#if defined(OS_ANDROID)
@@ -673,7 +674,7 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
scoped_refptr<ContextProviderCommandBuffer> context_provider;
if (!fallback) {
context_provider = ContextProviderCommandBuffer::Create(
- CreateGraphicsContext3D(attributes));
+ CreateGraphicsContext3D(attributes, max_bytes_pending_upload));
}
if (!context_provider.get()) {
@@ -2526,7 +2527,8 @@ bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const {
scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
RenderWidget::CreateGraphicsContext3D(
- const WebKit::WebGraphicsContext3D::Attributes& attributes) {
+ const WebKit::WebGraphicsContext3D::Attributes& attributes,
+ size_t max_bytes_pending_upload) {
if (!webwidget_)
return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -2539,10 +2541,19 @@ RenderWidget::CreateGraphicsContext3D(
RenderThreadImpl::current(),
weak_ptr_factory_.GetWeakPtr()));
- if (!context->InitializeWithDefaultBufferSizes(
+ // We keep the MappedMemoryReclaimLimit the same as the upload limit
+ // to avoid unnecessarily stalling the compositor thread.
+ const size_t kMappedMemoryReclaimLimit = max_bytes_pending_upload;
+
+ if (!context->Initialize(
attributes,
false /* bind generates resources */,
- CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE))
+ CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE,
+ kDefaultCommandBufferSize,
+ kDefaultStartTransferBufferSize,
+ kDefaultMinTransferBufferSize,
+ kDefaultMaxTransferBufferSize,
+ kMappedMemoryReclaimLimit))
return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
return context.Pass();
}
« cc/trees/layer_tree_host_impl.cc ('K') | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698