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

Unified Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h

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
Index: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
index 8b6c8b282c14c9f820bf72e6f621511a3a7b979b..f649a21cca9b66d7db5d25e73a99495c13641e5c 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
@@ -31,6 +31,7 @@ namespace gpu {
class ContextSupport;
class GpuChannelHost;
+struct SharedMemoryLimits;
class TransferBuffer;
namespace gles2 {
@@ -54,16 +55,6 @@ class WebGraphicsContext3DCommandBufferImpl
kNoLimit = 0,
};
- struct CONTENT_EXPORT SharedMemoryLimits {
- SharedMemoryLimits();
-
- size_t command_buffer_size;
- size_t start_transfer_buffer_size;
- size_t min_transfer_buffer_size;
- size_t max_transfer_buffer_size;
- size_t mapped_memory_reclaim_limit;
- };
-
class ShareGroup : public base::RefCountedThreadSafe<ShareGroup> {
public:
ShareGroup();
@@ -116,7 +107,6 @@ class WebGraphicsContext3DCommandBufferImpl
gfx::GpuPreference gpu_preference,
bool share_resources,
bool automatic_flushes,
- const SharedMemoryLimits& limits,
WebGraphicsContext3DCommandBufferImpl* share_context);
~WebGraphicsContext3DCommandBufferImpl() override;
@@ -131,11 +121,8 @@ class WebGraphicsContext3DCommandBufferImpl
return real_gl_.get();
}
- size_t GetMappedMemoryLimit() {
- return mem_limits_.mapped_memory_reclaim_limit;
- }
-
- CONTENT_EXPORT bool InitializeOnCurrentThread();
+ CONTENT_EXPORT bool InitializeOnCurrentThread(
+ const gpu::SharedMemoryLimits& memory_limits);
void SetContextType(CommandBufferContextType type) {
context_type_ = type;
@@ -152,7 +139,7 @@ class WebGraphicsContext3DCommandBufferImpl
// and subsequent calls are ignored. Must be called from the thread that is
// going to use this object to issue GL commands (which might not be the main
// thread).
- bool MaybeInitializeGL();
+ bool MaybeInitializeGL(const gpu::SharedMemoryLimits& memory_limits);
bool InitializeCommandBuffer(
WebGraphicsContext3DCommandBufferImpl* share_context);
@@ -172,7 +159,7 @@ class WebGraphicsContext3DCommandBufferImpl
// allocate both fake PluginWindowHandles and NativeViewIds and map
// from fake NativeViewIds to PluginWindowHandles, but this seems like
// unnecessary complexity at the moment.
- bool CreateContext();
+ bool CreateContext(const gpu::SharedMemoryLimits& memory_limits);
void OnContextLost();
@@ -192,7 +179,6 @@ class WebGraphicsContext3DCommandBufferImpl
std::unique_ptr<gpu::TransferBuffer> transfer_buffer_;
std::unique_ptr<gpu::gles2::GLES2Implementation> real_gl_;
std::unique_ptr<gpu::gles2::GLES2Interface> trace_gl_;
- SharedMemoryLimits mem_limits_;
scoped_refptr<ShareGroup> share_group_;
// Member variables should appear before the WeakPtrFactory, to ensure

Powered by Google App Engine
This is Rietveld 408576698