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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "content/common/gpu/image_transport_surface.h" | 7 #include "content/common/gpu/image_transport_surface.h" |
8 | 8 |
9 // Out of order because it has conflicts with other includes on Windows. | 9 // Out of order because it has conflicts with other includes on Windows. |
10 #include "third_party/angle/include/EGL/egl.h" | 10 #include "third_party/angle/include/EGL/egl.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 virtual bool DeferDraws() OVERRIDE; | 43 virtual bool DeferDraws() OVERRIDE; |
44 virtual bool IsOffscreen() OVERRIDE; | 44 virtual bool IsOffscreen() OVERRIDE; |
45 virtual bool SwapBuffers() OVERRIDE; | 45 virtual bool SwapBuffers() OVERRIDE; |
46 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 46 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
47 virtual std::string GetExtensions() OVERRIDE; | 47 virtual std::string GetExtensions() OVERRIDE; |
48 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; | 48 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; |
49 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; | 49 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; |
50 | 50 |
51 protected: | 51 protected: |
52 // ImageTransportSurface implementation | 52 // ImageTransportSurface implementation |
53 virtual void OnBufferPresented(bool presented, uint32 sync_point) OVERRIDE; | 53 virtual void OnBufferPresented(uint64 surface_handle, |
| 54 uint32 sync_point) OVERRIDE; |
54 virtual void OnResizeViewACK() OVERRIDE; | 55 virtual void OnResizeViewACK() OVERRIDE; |
55 virtual void OnResize(gfx::Size size) OVERRIDE; | 56 virtual void OnResize(gfx::Size size) OVERRIDE; |
56 virtual gfx::Size GetSize() OVERRIDE; | 57 virtual gfx::Size GetSize() OVERRIDE; |
57 | 58 |
58 private: | 59 private: |
59 virtual ~PbufferImageTransportSurface(); | 60 virtual ~PbufferImageTransportSurface(); |
60 void SendBuffersSwapped(); | 61 void SendBuffersSwapped(); |
61 void DestroySurface(); | 62 void DestroySurface(); |
62 | 63 |
63 // Tracks the current buffer allocation state. | 64 // Tracks the current buffer allocation state. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 params.surface_handle = reinterpret_cast<int64>(GetShareHandle()); | 200 params.surface_handle = reinterpret_cast<int64>(GetShareHandle()); |
200 CHECK(params.surface_handle); | 201 CHECK(params.surface_handle); |
201 params.size = GetSize(); | 202 params.size = GetSize(); |
202 | 203 |
203 helper_->SendAcceleratedSurfaceBuffersSwapped(params); | 204 helper_->SendAcceleratedSurfaceBuffersSwapped(params); |
204 | 205 |
205 DCHECK(!is_swap_buffers_pending_); | 206 DCHECK(!is_swap_buffers_pending_); |
206 is_swap_buffers_pending_ = true; | 207 is_swap_buffers_pending_ = true; |
207 } | 208 } |
208 | 209 |
209 void PbufferImageTransportSurface::OnBufferPresented(bool presented, | 210 void PbufferImageTransportSurface::OnBufferPresented(uint64 surface_handle, |
210 uint32 sync_point) { | 211 uint32 sync_point) { |
211 is_swap_buffers_pending_ = false; | 212 is_swap_buffers_pending_ = false; |
212 if (did_unschedule_) { | 213 if (did_unschedule_) { |
213 did_unschedule_ = false; | 214 did_unschedule_ = false; |
214 helper_->SetScheduled(true); | 215 helper_->SetScheduled(true); |
215 } | 216 } |
216 } | 217 } |
217 | 218 |
218 void PbufferImageTransportSurface::OnResizeViewACK() { | 219 void PbufferImageTransportSurface::OnResizeViewACK() { |
219 NOTREACHED(); | 220 NOTREACHED(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 284 |
284 if (surface->Initialize()) | 285 if (surface->Initialize()) |
285 return surface; | 286 return surface; |
286 else | 287 else |
287 return NULL; | 288 return NULL; |
288 } | 289 } |
289 | 290 |
290 } // namespace content | 291 } // namespace content |
291 | 292 |
292 #endif // ENABLE_GPU | 293 #endif // ENABLE_GPU |
OLD | NEW |