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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // on any failure. | 132 // on any failure. |
133 static CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl* | 133 static CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl* |
134 CreateOffscreenContext( | 134 CreateOffscreenContext( |
135 GpuChannelHost* host, | 135 GpuChannelHost* host, |
136 const WebGraphicsContext3D::Attributes& attributes, | 136 const WebGraphicsContext3D::Attributes& attributes, |
137 bool lose_context_when_out_of_memory, | 137 bool lose_context_when_out_of_memory, |
138 const GURL& active_url, | 138 const GURL& active_url, |
139 const SharedMemoryLimits& limits, | 139 const SharedMemoryLimits& limits, |
140 WebGraphicsContext3DCommandBufferImpl* share_context); | 140 WebGraphicsContext3DCommandBufferImpl* share_context); |
141 | 141 |
142 size_t GetMappedMemoryLimit() { | |
143 return mem_limits_.mapped_memory_reclaim_limit; | |
144 } | |
145 | |
146 CONTENT_EXPORT bool InitializeOnCurrentThread(); | 142 CONTENT_EXPORT bool InitializeOnCurrentThread(); |
147 | 143 |
148 void SetContextType(CommandBufferContextType type) { | 144 void SetContextType(CommandBufferContextType type) { |
149 context_type_ = type; | 145 context_type_ = type; |
150 } | 146 } |
151 private: | 147 private: |
152 // These are the same error codes as used by EGL. | 148 // These are the same error codes as used by EGL. |
153 enum Error { | 149 enum Error { |
154 SUCCESS = 0x3000, | 150 SUCCESS = 0x3000, |
155 BAD_ATTRIBUTE = 0x3004, | 151 BAD_ATTRIBUTE = 0x3004, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 204 |
209 // Member variables should appear before the WeakPtrFactory, to ensure | 205 // Member variables should appear before the WeakPtrFactory, to ensure |
210 // that any WeakPtrs to Controller are invalidated before its members | 206 // that any WeakPtrs to Controller are invalidated before its members |
211 // variable's destructors are executed, rendering them invalid. | 207 // variable's destructors are executed, rendering them invalid. |
212 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; | 208 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; |
213 }; | 209 }; |
214 | 210 |
215 } // namespace content | 211 } // namespace content |
216 | 212 |
217 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 213 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |