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 #include "gpu/command_buffer/client/gl_in_process_context.h" | 5 #include "gpu/command_buffer/client/gl_in_process_context.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 const unsigned int kDefaultStartTransferBufferSize = 4 * 1024 * 1024; | 41 const unsigned int kDefaultStartTransferBufferSize = 4 * 1024 * 1024; |
42 const unsigned int kDefaultMinTransferBufferSize = 1 * 256 * 1024; | 42 const unsigned int kDefaultMinTransferBufferSize = 1 * 256 * 1024; |
43 const unsigned int kDefaultMaxTransferBufferSize = 16 * 1024 * 1024; | 43 const unsigned int kDefaultMaxTransferBufferSize = 16 * 1024 * 1024; |
44 | 44 |
45 class GLInProcessContextImpl | 45 class GLInProcessContextImpl |
46 : public GLInProcessContext, | 46 : public GLInProcessContext, |
47 public base::SupportsWeakPtr<GLInProcessContextImpl> { | 47 public base::SupportsWeakPtr<GLInProcessContextImpl> { |
48 public: | 48 public: |
49 explicit GLInProcessContextImpl( | 49 explicit GLInProcessContextImpl( |
50 const GLInProcessContextSharedMemoryLimits& mem_limits); | 50 const GLInProcessContextSharedMemoryLimits& mem_limits); |
51 virtual ~GLInProcessContextImpl(); | 51 ~GLInProcessContextImpl() override; |
52 | 52 |
53 bool Initialize( | 53 bool Initialize( |
54 scoped_refptr<gfx::GLSurface> surface, | 54 scoped_refptr<gfx::GLSurface> surface, |
55 bool is_offscreen, | 55 bool is_offscreen, |
56 bool use_global_share_group, | 56 bool use_global_share_group, |
57 GLInProcessContext* share_context, | 57 GLInProcessContext* share_context, |
58 gfx::AcceleratedWidget window, | 58 gfx::AcceleratedWidget window, |
59 const gfx::Size& size, | 59 const gfx::Size& size, |
60 const gpu::gles2::ContextCreationAttribHelper& attribs, | 60 const gpu::gles2::ContextCreationAttribHelper& attribs, |
61 gfx::GpuPreference gpu_preference, | 61 gfx::GpuPreference gpu_preference, |
62 const scoped_refptr<InProcessCommandBuffer::Service>& service); | 62 const scoped_refptr<InProcessCommandBuffer::Service>& service); |
63 | 63 |
64 // GLInProcessContext implementation: | 64 // GLInProcessContext implementation: |
65 virtual void SetContextLostCallback(const base::Closure& callback) override; | 65 void SetContextLostCallback(const base::Closure& callback) override; |
66 virtual gles2::GLES2Implementation* GetImplementation() override; | 66 gles2::GLES2Implementation* GetImplementation() override; |
67 virtual size_t GetMappedMemoryLimit() override; | 67 size_t GetMappedMemoryLimit() override; |
68 | 68 |
69 #if defined(OS_ANDROID) | 69 #if defined(OS_ANDROID) |
70 virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( | 70 virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( |
71 uint32 stream_id) override; | 71 uint32 stream_id) override; |
72 #endif | 72 #endif |
73 | 73 |
74 private: | 74 private: |
75 void Destroy(); | 75 void Destroy(); |
76 void OnContextLost(); | 76 void OnContextLost(); |
77 void OnSignalSyncPoint(const base::Closure& callback); | 77 void OnSignalSyncPoint(const base::Closure& callback); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 size, | 289 size, |
290 attribs, | 290 attribs, |
291 gpu_preference, | 291 gpu_preference, |
292 service)) | 292 service)) |
293 return NULL; | 293 return NULL; |
294 | 294 |
295 return context.release(); | 295 return context.release(); |
296 } | 296 } |
297 | 297 |
298 } // namespace gpu | 298 } // namespace gpu |
OLD | NEW |