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

Unified Diff: mojo/gles2/gles2_context.cc

Issue 1900993002: Move SharedMemoryLimits out of WebGraphicsContext3DCommandBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@limits
Patch Set: move-limits: types 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 | « gpu/gles2_conform_support/egl/display.cc ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/gles2/gles2_context.cc
diff --git a/mojo/gles2/gles2_context.cc b/mojo/gles2/gles2_context.cc
index 58b86bd90d9d8e9d494b0f4c680c606d9e86a0fd..8159407b87feb43dcc99d2a39af7405568f96e7b 100644
--- a/mojo/gles2/gles2_context.cc
+++ b/mojo/gles2/gles2_context.cc
@@ -11,19 +11,13 @@
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
+#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "mojo/public/c/gles2/gles2.h"
#include "mojo/public/cpp/system/core.h"
namespace gles2 {
-namespace {
-const size_t kDefaultCommandBufferSize = 1024 * 1024;
-const size_t kDefaultStartTransferBufferSize = 1 * 1024 * 1024;
-const size_t kDefaultMinTransferBufferSize = 1 * 256 * 1024;
-const size_t kDefaultMaxTransferBufferSize = 16 * 1024 * 1024;
-}
-
GLES2Context::GLES2Context(const std::vector<int32_t>& attribs,
mojo::ScopedMessagePipeHandle command_buffer_handle,
MojoGLES2ContextLost lost_callback,
@@ -37,8 +31,10 @@ GLES2Context::~GLES2Context() {}
bool GLES2Context::Initialize() {
if (!command_buffer_.Initialize())
return false;
+
+ constexpr gpu::SharedMemoryLimits default_limits;
gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(&command_buffer_));
- if (!gles2_helper_->Initialize(kDefaultCommandBufferSize))
+ if (!gles2_helper_->Initialize(default_limits.command_buffer_size))
return false;
gles2_helper_->SetAutomaticFlushes(false);
transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get()));
@@ -57,10 +53,10 @@ bool GLES2Context::Initialize() {
lose_context_when_out_of_memory,
support_client_side_arrays,
&command_buffer_));
- if (!implementation_->Initialize(kDefaultStartTransferBufferSize,
- kDefaultMinTransferBufferSize,
- kDefaultMaxTransferBufferSize,
- gpu::gles2::GLES2Implementation::kNoLimit))
+ if (!implementation_->Initialize(default_limits.start_transfer_buffer_size,
+ default_limits.min_transfer_buffer_size,
+ default_limits.max_transfer_buffer_size,
+ default_limits.mapped_memory_reclaim_limit))
return false;
implementation_->SetLostContextCallback(
base::Bind(&GLES2Context::OnLostContext, base::Unretained(this)));
« no previous file with comments | « gpu/gles2_conform_support/egl/display.cc ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698