OLD | NEW |
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_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ |
6 #define GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ | 6 #define GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 class GPU_BLINK_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl | 34 class GPU_BLINK_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl |
35 : public WebGraphicsContext3DImpl { | 35 : public WebGraphicsContext3DImpl { |
36 public: | 36 public: |
37 enum MappedMemoryReclaimLimit { | 37 enum MappedMemoryReclaimLimit { |
38 kNoLimit = 0, | 38 kNoLimit = 0, |
39 }; | 39 }; |
40 | 40 |
41 static scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> | 41 static scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> |
42 CreateOffscreenContext( | 42 CreateOffscreenContext( |
43 const gpu::gles2::ContextCreationAttribHelper& attributes, | 43 const gpu::gles2::ContextCreationAttribHelper& attributes); |
44 bool share_resources); | |
45 | 44 |
46 static scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext( | 45 static scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext( |
47 scoped_ptr<::gpu::GLInProcessContext> context, | 46 scoped_ptr<::gpu::GLInProcessContext> context, |
48 const gpu::gles2::ContextCreationAttribHelper& attributes); | 47 const gpu::gles2::ContextCreationAttribHelper& attributes); |
49 | 48 |
50 ~WebGraphicsContext3DInProcessCommandBufferImpl() override; | 49 ~WebGraphicsContext3DInProcessCommandBufferImpl() override; |
51 | 50 |
52 size_t GetMappedMemoryLimit(); | 51 size_t GetMappedMemoryLimit(); |
53 | 52 |
54 bool InitializeOnCurrentThread(); | 53 bool InitializeOnCurrentThread(); |
55 void SetLock(base::Lock* lock); | 54 void SetLock(base::Lock* lock); |
56 | 55 |
57 ::gpu::ContextSupport* GetContextSupport(); | 56 ::gpu::ContextSupport* GetContextSupport(); |
58 | 57 |
59 ::gpu::gles2::GLES2Implementation* GetImplementation() { | 58 ::gpu::gles2::GLES2Implementation* GetImplementation() { |
60 return real_gl_; | 59 return real_gl_; |
61 } | 60 } |
62 | 61 |
63 private: | 62 private: |
64 WebGraphicsContext3DInProcessCommandBufferImpl( | 63 WebGraphicsContext3DInProcessCommandBufferImpl( |
65 scoped_ptr<::gpu::GLInProcessContext> context, | 64 scoped_ptr<::gpu::GLInProcessContext> context, |
66 const gpu::gles2::ContextCreationAttribHelper& attributes, | 65 const gpu::gles2::ContextCreationAttribHelper& attributes, |
67 bool share_resources, | |
68 bool is_offscreen, | 66 bool is_offscreen, |
69 gfx::AcceleratedWidget window); | 67 gfx::AcceleratedWidget window); |
70 | 68 |
71 void OnContextLost(); | 69 void OnContextLost(); |
72 | 70 |
73 bool MaybeInitializeGL(); | 71 bool MaybeInitializeGL(); |
74 | 72 |
75 // Used to try to find bugs in code that calls gl directly through the gl api | 73 // Used to try to find bugs in code that calls gl directly through the gl api |
76 // instead of going through WebGraphicsContext3D. | 74 // instead of going through WebGraphicsContext3D. |
77 void ClearContext(); | 75 void ClearContext(); |
78 | 76 |
79 ::gpu::gles2::ContextCreationAttribHelper attributes_; | 77 ::gpu::gles2::ContextCreationAttribHelper attributes_; |
80 bool share_resources_; | |
81 | 78 |
82 bool is_offscreen_; | 79 bool is_offscreen_; |
83 // Only used when not offscreen. | 80 // Only used when not offscreen. |
84 gfx::AcceleratedWidget window_; | 81 gfx::AcceleratedWidget window_; |
85 | 82 |
86 // The context we use for OpenGL rendering. | 83 // The context we use for OpenGL rendering. |
87 scoped_ptr< ::gpu::GLInProcessContext> context_; | 84 scoped_ptr< ::gpu::GLInProcessContext> context_; |
88 // The GLES2Implementation we use for OpenGL rendering. | 85 // The GLES2Implementation we use for OpenGL rendering. |
89 ::gpu::gles2::GLES2Implementation* real_gl_; | 86 ::gpu::gles2::GLES2Implementation* real_gl_; |
90 }; | 87 }; |
91 | 88 |
92 } // namespace gpu_blink | 89 } // namespace gpu_blink |
93 | 90 |
94 #endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ | 91 #endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |