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 #pragma once | 7 #pragma once |
8 | 8 |
9 #if defined(ENABLE_GPU) | 9 #if defined(ENABLE_GPU) |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 public: | 60 public: |
61 ImageTransportSurface(); | 61 ImageTransportSurface(); |
62 virtual ~ImageTransportSurface(); | 62 virtual ~ImageTransportSurface(); |
63 | 63 |
64 virtual void OnNewSurfaceACK( | 64 virtual void OnNewSurfaceACK( |
65 uint64 surface_id, TransportDIB::Handle surface_handle) = 0; | 65 uint64 surface_id, TransportDIB::Handle surface_handle) = 0; |
66 virtual void OnBuffersSwappedACK() = 0; | 66 virtual void OnBuffersSwappedACK() = 0; |
67 virtual void OnPostSubBufferACK() = 0; | 67 virtual void OnPostSubBufferACK() = 0; |
68 virtual void OnResizeViewACK() = 0; | 68 virtual void OnResizeViewACK() = 0; |
69 virtual void OnResize(gfx::Size size) = 0; | 69 virtual void OnResize(gfx::Size size) = 0; |
| 70 virtual void OnSetFrontSurfaceIsProtected(bool is_protected, |
| 71 uint32 protection_state_id); |
70 | 72 |
71 // Creates the appropriate surface depending on the GL implementation. | 73 // Creates the appropriate surface depending on the GL implementation. |
72 static scoped_refptr<gfx::GLSurface> | 74 static scoped_refptr<gfx::GLSurface> |
73 CreateSurface(GpuChannelManager* manager, | 75 CreateSurface(GpuChannelManager* manager, |
74 GpuCommandBufferStub* stub, | 76 GpuCommandBufferStub* stub, |
75 const gfx::GLSurfaceHandle& handle); | 77 const gfx::GLSurfaceHandle& handle); |
76 protected: | 78 protected: |
77 // Used by certain implements of PostSubBuffer to determine | 79 // Used by certain implements of PostSubBuffer to determine |
78 // how much needs to be copied between frames. | 80 // how much needs to be copied between frames. |
79 void GetRegionsToCopy(const gfx::Rect& previous_damage_rect, | 81 void GetRegionsToCopy(const gfx::Rect& previous_damage_rect, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 133 |
132 private: | 134 private: |
133 gpu::GpuScheduler* Scheduler(); | 135 gpu::GpuScheduler* Scheduler(); |
134 gpu::gles2::GLES2Decoder* Decoder(); | 136 gpu::gles2::GLES2Decoder* Decoder(); |
135 | 137 |
136 // IPC::Message handlers. | 138 // IPC::Message handlers. |
137 void OnNewSurfaceACK(uint64 surface_handle, TransportDIB::Handle shm_handle); | 139 void OnNewSurfaceACK(uint64 surface_handle, TransportDIB::Handle shm_handle); |
138 void OnBuffersSwappedACK(); | 140 void OnBuffersSwappedACK(); |
139 void OnPostSubBufferACK(); | 141 void OnPostSubBufferACK(); |
140 void OnResizeViewACK(); | 142 void OnResizeViewACK(); |
| 143 void OnSetFrontSurfaceIsProtected(bool is_protected, |
| 144 uint32 protection_state_id); |
141 | 145 |
142 // Backbuffer resize callback. | 146 // Backbuffer resize callback. |
143 void Resize(gfx::Size size); | 147 void Resize(gfx::Size size); |
144 | 148 |
145 // Weak pointers that point to objects that outlive this helper. | 149 // Weak pointers that point to objects that outlive this helper. |
146 ImageTransportSurface* surface_; | 150 ImageTransportSurface* surface_; |
147 GpuChannelManager* manager_; | 151 GpuChannelManager* manager_; |
148 | 152 |
149 base::WeakPtr<GpuCommandBufferStub> stub_; | 153 base::WeakPtr<GpuCommandBufferStub> stub_; |
150 int32 route_id_; | 154 int32 route_id_; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 gfx::Size new_size_; | 191 gfx::Size new_size_; |
188 bool transport_; | 192 bool transport_; |
189 bool did_set_swap_interval_; | 193 bool did_set_swap_interval_; |
190 | 194 |
191 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); | 195 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); |
192 }; | 196 }; |
193 | 197 |
194 #endif // defined(ENABLE_GPU) | 198 #endif // defined(ENABLE_GPU) |
195 | 199 |
196 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ | 200 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ |
OLD | NEW |