| 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 CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const WebGraphicsContext3D::Attributes& attributes, | 135 const WebGraphicsContext3D::Attributes& attributes, |
| 136 bool lose_context_when_out_of_memory, | 136 bool lose_context_when_out_of_memory, |
| 137 const GURL& active_url, | 137 const GURL& active_url, |
| 138 const SharedMemoryLimits& limits, | 138 const SharedMemoryLimits& limits, |
| 139 WebGraphicsContext3DCommandBufferImpl* share_context); | 139 WebGraphicsContext3DCommandBufferImpl* share_context); |
| 140 | 140 |
| 141 size_t GetMappedMemoryLimit() { | 141 size_t GetMappedMemoryLimit() { |
| 142 return mem_limits_.mapped_memory_reclaim_limit; | 142 return mem_limits_.mapped_memory_reclaim_limit; |
| 143 } | 143 } |
| 144 | 144 |
| 145 // WebGraphicsContext3DImpl methods |
| 146 virtual bool InitializeOnCurrentThread() OVERRIDE; |
| 147 |
| 145 //---------------------------------------------------------------------- | 148 //---------------------------------------------------------------------- |
| 146 // WebGraphicsContext3D methods | 149 // WebGraphicsContext3D methods |
| 147 | |
| 148 // Must be called after initialize() and before any of the following methods. | |
| 149 // Permanently binds to the first calling thread. Returns false if the | |
| 150 // graphics context fails to create. Do not call from more than one thread. | |
| 151 virtual bool makeContextCurrent(); | |
| 152 | |
| 153 virtual bool isContextLost(); | 150 virtual bool isContextLost(); |
| 154 | 151 |
| 155 virtual WGC3Denum getGraphicsResetStatusARB(); | 152 virtual WGC3Denum getGraphicsResetStatusARB(); |
| 156 | 153 |
| 157 private: | 154 private: |
| 158 // These are the same error codes as used by EGL. | 155 // These are the same error codes as used by EGL. |
| 159 enum Error { | 156 enum Error { |
| 160 SUCCESS = 0x3000, | 157 SUCCESS = 0x3000, |
| 161 BAD_ATTRIBUTE = 0x3004, | 158 BAD_ATTRIBUTE = 0x3004, |
| 162 CONTEXT_LOST = 0x300E | 159 CONTEXT_LOST = 0x300E |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 scoped_ptr<gpu::gles2::GLES2Implementation> real_gl_; | 207 scoped_ptr<gpu::gles2::GLES2Implementation> real_gl_; |
| 211 scoped_ptr<gpu::gles2::GLES2Interface> trace_gl_; | 208 scoped_ptr<gpu::gles2::GLES2Interface> trace_gl_; |
| 212 Error last_error_; | 209 Error last_error_; |
| 213 SharedMemoryLimits mem_limits_; | 210 SharedMemoryLimits mem_limits_; |
| 214 scoped_refptr<ShareGroup> share_group_; | 211 scoped_refptr<ShareGroup> share_group_; |
| 215 }; | 212 }; |
| 216 | 213 |
| 217 } // namespace content | 214 } // namespace content |
| 218 | 215 |
| 219 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 216 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
| OLD | NEW |