| 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();
|
| }
|
|
|