Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "content/common/gpu/client/command_buffer_metrics.h" | 21 #include "content/common/gpu/client/command_buffer_metrics.h" |
| 22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 23 #include "gpu/ipc/client/command_buffer_proxy_impl.h" | 23 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
| 24 #include "gpu/ipc/common/surface_handle.h" | 24 #include "gpu/ipc/common/surface_handle.h" |
| 25 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | |
| 26 #include "third_party/WebKit/public/platform/WebString.h" | 25 #include "third_party/WebKit/public/platform/WebString.h" |
|
Fady Samuel
2016/04/30 00:22:28
Drive by nit: Is this include still necessary?
danakj
2016/04/30 00:25:54
Probably not, I'm deleting this whole file though
| |
| 27 #include "ui/gl/gpu_preference.h" | 26 #include "ui/gl/gpu_preference.h" |
| 28 #include "url/gurl.h" | 27 #include "url/gurl.h" |
| 29 | 28 |
| 30 namespace gpu { | 29 namespace gpu { |
| 31 | 30 |
| 32 class ContextSupport; | 31 class ContextSupport; |
| 33 class GpuChannelHost; | 32 class GpuChannelHost; |
| 34 struct SharedMemoryLimits; | 33 struct SharedMemoryLimits; |
| 35 class TransferBuffer; | 34 class TransferBuffer; |
| 36 | 35 |
| 37 namespace gles2 { | 36 namespace gles2 { |
| 38 class GLES2CmdHelper; | 37 class GLES2CmdHelper; |
| 39 class GLES2Implementation; | 38 class GLES2Implementation; |
| 40 class GLES2Interface; | 39 class GLES2Interface; |
| 41 class ShareGroup; | 40 class ShareGroup; |
| 42 } | 41 } |
| 43 } | 42 } |
| 44 | 43 |
| 45 namespace content { | 44 namespace content { |
| 46 | 45 |
| 47 class WebGraphicsContext3DCommandBufferImpl | 46 class WebGraphicsContext3DCommandBufferImpl { |
| 48 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) { | |
| 49 public: | 47 public: |
| 50 enum MappedMemoryReclaimLimit { | 48 enum MappedMemoryReclaimLimit { |
| 51 kNoLimit = 0, | 49 kNoLimit = 0, |
| 52 }; | 50 }; |
| 53 | 51 |
| 54 class WebGraphicsContextLostCallback { | 52 class WebGraphicsContextLostCallback { |
| 55 public: | 53 public: |
| 56 virtual void onContextLost() = 0; | 54 virtual void onContextLost() = 0; |
| 57 | 55 |
| 58 protected: | 56 protected: |
| 59 virtual ~WebGraphicsContextLostCallback() {} | 57 virtual ~WebGraphicsContextLostCallback() {} |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 // If surface_handle is not kNullSurfaceHandle, this creates a | 60 // If surface_handle is not kNullSurfaceHandle, this creates a |
| 63 // CommandBufferProxy that renders directly to a view. The view and | 61 // CommandBufferProxy that renders directly to a view. The view and |
| 64 // the associated window must not be destroyed until the returned | 62 // the associated window must not be destroyed until the returned |
| 65 // CommandBufferProxy has been destroyed, otherwise the GPU process might | 63 // CommandBufferProxy has been destroyed, otherwise the GPU process might |
| 66 // attempt to render to an invalid window handle. | 64 // attempt to render to an invalid window handle. |
| 67 CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl( | 65 CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl( |
| 68 gpu::SurfaceHandle surface_handle, | 66 gpu::SurfaceHandle surface_handle, |
| 69 const GURL& active_url, | 67 const GURL& active_url, |
| 70 gpu::GpuChannelHost* host, | 68 gpu::GpuChannelHost* host, |
| 71 const gpu::gles2::ContextCreationAttribHelper& attributes, | 69 const gpu::gles2::ContextCreationAttribHelper& attributes, |
| 72 gfx::GpuPreference gpu_preference, | 70 gfx::GpuPreference gpu_preference, |
| 73 bool automatic_flushes); | 71 bool automatic_flushes); |
| 74 | 72 |
| 75 ~WebGraphicsContext3DCommandBufferImpl() override; | 73 CONTENT_EXPORT ~WebGraphicsContext3DCommandBufferImpl(); |
| 76 | 74 |
| 77 gpu::CommandBufferProxyImpl* GetCommandBufferProxy() { | 75 gpu::CommandBufferProxyImpl* GetCommandBufferProxy() { |
| 78 return command_buffer_.get(); | 76 return command_buffer_.get(); |
| 79 } | 77 } |
| 80 | 78 |
| 81 CONTENT_EXPORT gpu::ContextSupport* GetContextSupport(); | 79 CONTENT_EXPORT gpu::ContextSupport* GetContextSupport(); |
| 82 | 80 |
| 83 gpu::gles2::GLES2Implementation* GetImplementation() { | 81 gpu::gles2::GLES2Implementation* GetImplementation() { |
| 84 return real_gl_.get(); | 82 return real_gl_.get(); |
| 85 } | 83 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 | 144 |
| 147 // Member variables should appear before the WeakPtrFactory, to ensure | 145 // Member variables should appear before the WeakPtrFactory, to ensure |
| 148 // that any WeakPtrs to Controller are invalidated before its members | 146 // that any WeakPtrs to Controller are invalidated before its members |
| 149 // variable's destructors are executed, rendering them invalid. | 147 // variable's destructors are executed, rendering them invalid. |
| 150 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; | 148 base::WeakPtrFactory<WebGraphicsContext3DCommandBufferImpl> weak_ptr_factory_; |
| 151 }; | 149 }; |
| 152 | 150 |
| 153 } // namespace content | 151 } // namespace content |
| 154 | 152 |
| 155 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 153 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
| OLD | NEW |