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