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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual void OnBufferPresented(uint32 sync_point) = 0; | 64 virtual void OnBufferPresented(uint32 sync_point) = 0; |
65 virtual void OnResizeViewACK() = 0; | 65 virtual void OnResizeViewACK() = 0; |
66 virtual void OnResize(gfx::Size size) = 0; | 66 virtual void OnResize(gfx::Size size) = 0; |
67 | 67 |
68 // Creates the appropriate surface depending on the GL implementation. | 68 // Creates the appropriate surface depending on the GL implementation. |
69 static scoped_refptr<gfx::GLSurface> | 69 static scoped_refptr<gfx::GLSurface> |
70 CreateSurface(GpuChannelManager* manager, | 70 CreateSurface(GpuChannelManager* manager, |
71 GpuCommandBufferStub* stub, | 71 GpuCommandBufferStub* stub, |
72 const gfx::GLSurfaceHandle& handle); | 72 const gfx::GLSurfaceHandle& handle); |
73 | 73 |
| 74 virtual gfx::Size GetSize() = 0; |
| 75 |
74 protected: | 76 protected: |
75 // Used by certain implements of PostSubBuffer to determine | 77 // Used by certain implements of PostSubBuffer to determine |
76 // how much needs to be copied between frames. | 78 // how much needs to be copied between frames. |
77 void GetRegionsToCopy(const gfx::Rect& previous_damage_rect, | 79 void GetRegionsToCopy(const gfx::Rect& previous_damage_rect, |
78 const gfx::Rect& new_damage_rect, | 80 const gfx::Rect& new_damage_rect, |
79 std::vector<gfx::Rect>* regions); | 81 std::vector<gfx::Rect>* regions); |
80 | 82 |
81 protected: | 83 protected: |
82 virtual ~ImageTransportSurface(); | 84 virtual ~ImageTransportSurface(); |
83 | 85 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 virtual bool SwapBuffers() OVERRIDE; | 172 virtual bool SwapBuffers() OVERRIDE; |
171 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 173 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
172 virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; | 174 virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; |
173 | 175 |
174 // ImageTransportSurface implementation. | 176 // ImageTransportSurface implementation. |
175 virtual void OnNewSurfaceACK( | 177 virtual void OnNewSurfaceACK( |
176 uint64 surface_handle, TransportDIB::Handle shm_handle) OVERRIDE; | 178 uint64 surface_handle, TransportDIB::Handle shm_handle) OVERRIDE; |
177 virtual void OnBufferPresented(uint32 sync_point) OVERRIDE; | 179 virtual void OnBufferPresented(uint32 sync_point) OVERRIDE; |
178 virtual void OnResizeViewACK() OVERRIDE; | 180 virtual void OnResizeViewACK() OVERRIDE; |
179 virtual void OnResize(gfx::Size size) OVERRIDE; | 181 virtual void OnResize(gfx::Size size) OVERRIDE; |
| 182 virtual gfx::Size GetSize() OVERRIDE; |
180 | 183 |
181 protected: | 184 protected: |
182 virtual ~PassThroughImageTransportSurface(); | 185 virtual ~PassThroughImageTransportSurface(); |
183 | 186 |
184 private: | 187 private: |
185 scoped_ptr<ImageTransportHelper> helper_; | 188 scoped_ptr<ImageTransportHelper> helper_; |
186 gfx::Size new_size_; | 189 gfx::Size new_size_; |
187 bool transport_; | 190 bool transport_; |
188 bool did_set_swap_interval_; | 191 bool did_set_swap_interval_; |
189 | 192 |
190 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); | 193 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); |
191 }; | 194 }; |
192 | 195 |
193 #endif // defined(ENABLE_GPU) | 196 #endif // defined(ENABLE_GPU) |
194 | 197 |
195 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ | 198 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ |
OLD | NEW |