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

Unified Diff: android_webview/browser/aw_render_thread_context_provider.cc

Issue 1898033005: Use gpu::SharedMemoryLimits for in process GL contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-limits
Patch Set: inproc-limits: webviewlimits Created 4 years, 8 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
« no previous file with comments | « no previous file | blimp/client/feature/compositor/blimp_context_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_render_thread_context_provider.cc
diff --git a/android_webview/browser/aw_render_thread_context_provider.cc b/android_webview/browser/aw_render_thread_context_provider.cc
index 93251fa6604a923d66b63f99a0db2a4858fd6abc..3d6ba59ca1a3a5a57b9e52ab372f1c4bcd152426 100644
--- a/android_webview/browser/aw_render_thread_context_provider.cc
+++ b/android_webview/browser/aw_render_thread_context_provider.cc
@@ -13,6 +13,7 @@
#include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
+#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
@@ -50,11 +51,20 @@ AwRenderThreadContextProvider::AwRenderThreadContextProvider(
attributes.samples = 0;
attributes.sample_buffers = 0;
attributes.bind_generates_resource = false;
+
+ gpu::SharedMemoryLimits limits;
+ // This context is only used for the display compositor, and there are no
+ // uploads done with it at all. We choose a small transfer buffer limit
+ // here, the minimums match the display compositor context for the android
+ // browser. We don't set the max since we expect the transfer buffer to be
+ // relatively unused.
+ limits.start_transfer_buffer_size = 64 * 1024;
+ limits.min_transfer_buffer_size = 64 * 1024;
+
context_.reset(gpu::GLInProcessContext::Create(
service, surface, surface->IsOffscreen(), gfx::kNullAcceleratedWidget,
surface->GetSize(), nullptr /* share_context */, attributes,
- gfx::PreferDiscreteGpu, gpu::GLInProcessContextSharedMemoryLimits(),
- nullptr, nullptr));
+ gfx::PreferDiscreteGpu, limits, nullptr, nullptr));
context_->GetImplementation()->SetLostContextCallback(base::Bind(
&AwRenderThreadContextProvider::OnLostContext, base::Unretained(this)));
« no previous file with comments | « no previous file | blimp/client/feature/compositor/blimp_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698