| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void PbufferImageTransportSurface::Destroy() { | 111 void PbufferImageTransportSurface::Destroy() { |
| 112 helper_->Destroy(); | 112 helper_->Destroy(); |
| 113 GLSurfaceAdapter::Destroy(); | 113 GLSurfaceAdapter::Destroy(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool PbufferImageTransportSurface::DeferDraws() { | 116 bool PbufferImageTransportSurface::DeferDraws() { |
| 117 // The command buffer hit a draw/clear command that could clobber the | 117 // The command buffer hit a draw/clear command that could clobber the |
| 118 // IOSurface in use by an earlier SwapBuffers. If a Swap is pending, abort | 118 // IOSurface in use by an earlier SwapBuffers. If a Swap is pending, abort |
| 119 // processing of the command by returning true and unschedule until the Swap | 119 // processing of the command by returning true and unschedule until the Swap |
| 120 // Ack arrives. | 120 // Ack arrives. |
| 121 DCHECK(!did_unschedule_); | 121 if (did_unschedule_) |
| 122 return true; |
| 122 if (is_swap_buffers_pending_) { | 123 if (is_swap_buffers_pending_) { |
| 123 did_unschedule_ = true; | 124 did_unschedule_ = true; |
| 124 helper_->SetScheduled(false); | 125 helper_->SetScheduled(false); |
| 125 return true; | 126 return true; |
| 126 } | 127 } |
| 127 return false; | 128 return false; |
| 128 } | 129 } |
| 129 | 130 |
| 130 bool PbufferImageTransportSurface::IsOffscreen() { | 131 bool PbufferImageTransportSurface::IsOffscreen() { |
| 131 return false; | 132 return false; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 280 } |
| 280 } | 281 } |
| 281 | 282 |
| 282 if (surface->Initialize()) | 283 if (surface->Initialize()) |
| 283 return surface; | 284 return surface; |
| 284 else | 285 else |
| 285 return NULL; | 286 return NULL; |
| 286 } | 287 } |
| 287 | 288 |
| 288 #endif // ENABLE_GPU | 289 #endif // ENABLE_GPU |
| OLD | NEW |