| 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_IMAGE_TRANSPORT_SURFACE_H_ | 5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ |
| 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ | 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ |
| 7 | 7 |
| 8 #if defined(ENABLE_GPU) | 8 #if defined(ENABLE_GPU) |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // making sure outside events reach the ImageTransportSurface and | 56 // making sure outside events reach the ImageTransportSurface and |
| 57 // allowing the ImageTransportSurface to send events to the outside world. | 57 // allowing the ImageTransportSurface to send events to the outside world. |
| 58 | 58 |
| 59 class ImageTransportSurface { | 59 class ImageTransportSurface { |
| 60 public: | 60 public: |
| 61 ImageTransportSurface(); | 61 ImageTransportSurface(); |
| 62 | 62 |
| 63 virtual void OnBufferPresented(uint32 sync_point) = 0; | 63 virtual void OnBufferPresented(uint32 sync_point) = 0; |
| 64 virtual void OnResizeViewACK() = 0; | 64 virtual void OnResizeViewACK() = 0; |
| 65 virtual void OnResize(gfx::Size size) = 0; | 65 virtual void OnResize(gfx::Size size) = 0; |
| 66 virtual void OnSetFrontSurfaceIsProtected(bool is_protected, | |
| 67 uint32 protection_state_id); | |
| 68 | 66 |
| 69 // Creates the appropriate surface depending on the GL implementation. | 67 // Creates the appropriate surface depending on the GL implementation. |
| 70 static scoped_refptr<gfx::GLSurface> | 68 static scoped_refptr<gfx::GLSurface> |
| 71 CreateSurface(GpuChannelManager* manager, | 69 CreateSurface(GpuChannelManager* manager, |
| 72 GpuCommandBufferStub* stub, | 70 GpuCommandBufferStub* stub, |
| 73 const gfx::GLSurfaceHandle& handle); | 71 const gfx::GLSurfaceHandle& handle); |
| 74 | 72 |
| 75 virtual gfx::Size GetSize() = 0; | 73 virtual gfx::Size GetSize() = 0; |
| 76 | 74 |
| 77 protected: | 75 protected: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 GpuChannelManager* manager() const { return manager_; } | 132 GpuChannelManager* manager() const { return manager_; } |
| 135 GpuCommandBufferStub* stub() const { return stub_.get(); } | 133 GpuCommandBufferStub* stub() const { return stub_.get(); } |
| 136 | 134 |
| 137 private: | 135 private: |
| 138 gpu::GpuScheduler* Scheduler(); | 136 gpu::GpuScheduler* Scheduler(); |
| 139 gpu::gles2::GLES2Decoder* Decoder(); | 137 gpu::gles2::GLES2Decoder* Decoder(); |
| 140 | 138 |
| 141 // IPC::Message handlers. | 139 // IPC::Message handlers. |
| 142 void OnBufferPresented(uint32 sync_point); | 140 void OnBufferPresented(uint32 sync_point); |
| 143 void OnResizeViewACK(); | 141 void OnResizeViewACK(); |
| 144 void OnSetFrontSurfaceIsProtected(bool is_protected, | |
| 145 uint32 protection_state_id); | |
| 146 | 142 |
| 147 // Backbuffer resize callback. | 143 // Backbuffer resize callback. |
| 148 void Resize(gfx::Size size); | 144 void Resize(gfx::Size size); |
| 149 | 145 |
| 150 // Weak pointers that point to objects that outlive this helper. | 146 // Weak pointers that point to objects that outlive this helper. |
| 151 ImageTransportSurface* surface_; | 147 ImageTransportSurface* surface_; |
| 152 GpuChannelManager* manager_; | 148 GpuChannelManager* manager_; |
| 153 | 149 |
| 154 base::WeakPtr<GpuCommandBufferStub> stub_; | 150 base::WeakPtr<GpuCommandBufferStub> stub_; |
| 155 int32 route_id_; | 151 int32 route_id_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 bool did_set_swap_interval_; | 188 bool did_set_swap_interval_; |
| 193 | 189 |
| 194 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); | 190 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); |
| 195 }; | 191 }; |
| 196 | 192 |
| 197 } // namespace content | 193 } // namespace content |
| 198 | 194 |
| 199 #endif // defined(ENABLE_GPU) | 195 #endif // defined(ENABLE_GPU) |
| 200 | 196 |
| 201 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ | 197 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ |
| OLD | NEW |