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

Side by Side Diff: gpu/command_buffer/client/gl_in_process_context.h

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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ 6 #define GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 10 matching lines...) Expand all
21 class Size; 21 class Size;
22 } 22 }
23 23
24 #if defined(OS_ANDROID) 24 #if defined(OS_ANDROID)
25 namespace gfx { 25 namespace gfx {
26 class SurfaceTexture; 26 class SurfaceTexture;
27 } 27 }
28 #endif 28 #endif
29 29
30 namespace gpu { 30 namespace gpu {
31 struct SharedMemoryLimits;
31 32
32 namespace gles2 { 33 namespace gles2 {
33 class GLES2Implementation; 34 class GLES2Implementation;
34 } 35 }
35 36
36 struct GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContextSharedMemoryLimits {
37 GLInProcessContextSharedMemoryLimits();
38
39 int32_t command_buffer_size;
40 unsigned int start_transfer_buffer_size;
41 unsigned int min_transfer_buffer_size;
42 unsigned int max_transfer_buffer_size;
43 unsigned int mapped_memory_reclaim_limit;
44 };
45
46 class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext { 37 class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
47 public: 38 public:
48 virtual ~GLInProcessContext() {} 39 virtual ~GLInProcessContext() {}
49 40
50 // Create a GLInProcessContext, if |is_offscreen| is true, renders to an 41 // Create a GLInProcessContext, if |is_offscreen| is true, renders to an
51 // offscreen context. |attrib_list| must be NULL or a NONE-terminated list 42 // offscreen context. |attrib_list| must be NULL or a NONE-terminated list
52 // of attribute/value pairs. 43 // of attribute/value pairs.
53 // If |surface| is not NULL, then it must match |is_offscreen| and |size|, 44 // If |surface| is not NULL, then it must match |is_offscreen| and |size|,
54 // |window| must be gfx::kNullAcceleratedWidget, and the command buffer 45 // |window| must be gfx::kNullAcceleratedWidget, and the command buffer
55 // service must run on the same thread as this client because GLSurface is 46 // service must run on the same thread as this client because GLSurface is
56 // not thread safe. If |surface| is NULL, then the other parameters are used 47 // not thread safe. If |surface| is NULL, then the other parameters are used
57 // to correctly create a surface. 48 // to correctly create a surface.
58 static GLInProcessContext* Create( 49 static GLInProcessContext* Create(
59 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, 50 scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
60 scoped_refptr<gfx::GLSurface> surface, 51 scoped_refptr<gfx::GLSurface> surface,
61 bool is_offscreen, 52 bool is_offscreen,
62 gfx::AcceleratedWidget window, 53 gfx::AcceleratedWidget window,
63 const gfx::Size& size, 54 const gfx::Size& size,
64 GLInProcessContext* share_context, 55 GLInProcessContext* share_context,
65 const gpu::gles2::ContextCreationAttribHelper& attribs, 56 const gpu::gles2::ContextCreationAttribHelper& attribs,
66 gfx::GpuPreference gpu_preference, 57 gfx::GpuPreference gpu_preference,
67 const GLInProcessContextSharedMemoryLimits& memory_limits, 58 const SharedMemoryLimits& memory_limits,
68 GpuMemoryBufferManager* gpu_memory_buffer_manager, 59 GpuMemoryBufferManager* gpu_memory_buffer_manager,
69 ImageFactory* image_factory); 60 ImageFactory* image_factory);
70 61
71 // Allows direct access to the GLES2 implementation so a GLInProcessContext 62 // Allows direct access to the GLES2 implementation so a GLInProcessContext
72 // can be used without making it current. 63 // can be used without making it current.
73 virtual gles2::GLES2Implementation* GetImplementation() = 0; 64 virtual gles2::GLES2Implementation* GetImplementation() = 0;
74 65
75 virtual size_t GetMappedMemoryLimit() = 0;
76
77 virtual void SetLock(base::Lock* lock) = 0; 66 virtual void SetLock(base::Lock* lock) = 0;
78 }; 67 };
79 68
80 } // namespace gpu 69 } // namespace gpu
81 70
82 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ 71 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_in_process_context_tests.cc ('k') | gpu/command_buffer/client/gl_in_process_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698