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 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (!stub_.get()) | 205 if (!stub_.get()) |
206 return NULL; | 206 return NULL; |
207 return stub_->decoder(); | 207 return stub_->decoder(); |
208 } | 208 } |
209 | 209 |
210 void ImageTransportHelper::OnSetFrontSurfaceIsProtected( | 210 void ImageTransportHelper::OnSetFrontSurfaceIsProtected( |
211 bool is_protected, uint32 protection_state_id) { | 211 bool is_protected, uint32 protection_state_id) { |
212 surface_->OnSetFrontSurfaceIsProtected(is_protected, protection_state_id); | 212 surface_->OnSetFrontSurfaceIsProtected(is_protected, protection_state_id); |
213 } | 213 } |
214 | 214 |
215 void ImageTransportHelper::OnBufferPresented(uint32 sync_point) { | 215 void ImageTransportHelper::OnBufferPresented(bool presented, |
216 surface_->OnBufferPresented(sync_point); | 216 uint32 sync_point) { |
| 217 surface_->OnBufferPresented(presented, sync_point); |
217 } | 218 } |
218 | 219 |
219 void ImageTransportHelper::OnResizeViewACK() { | 220 void ImageTransportHelper::OnResizeViewACK() { |
220 surface_->OnResizeViewACK(); | 221 surface_->OnResizeViewACK(); |
221 } | 222 } |
222 | 223 |
223 void ImageTransportHelper::Resize(gfx::Size size) { | 224 void ImageTransportHelper::Resize(gfx::Size size) { |
224 // On windows, the surface is recreated and, in case the newly allocated | 225 // On windows, the surface is recreated and, in case the newly allocated |
225 // surface happens to have the same address, it should be invalidated on the | 226 // surface happens to have the same address, it should be invalidated on the |
226 // decoder so that future calls to MakeCurrent do not early out on the | 227 // decoder so that future calls to MakeCurrent do not early out on the |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 } | 305 } |
305 | 306 |
306 bool PassThroughImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) { | 307 bool PassThroughImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) { |
307 if (!did_set_swap_interval_) { | 308 if (!did_set_swap_interval_) { |
308 ImageTransportHelper::SetSwapInterval(context); | 309 ImageTransportHelper::SetSwapInterval(context); |
309 did_set_swap_interval_ = true; | 310 did_set_swap_interval_ = true; |
310 } | 311 } |
311 return true; | 312 return true; |
312 } | 313 } |
313 | 314 |
314 void PassThroughImageTransportSurface::OnBufferPresented(uint32 sync_point) { | 315 void PassThroughImageTransportSurface::OnBufferPresented( |
| 316 bool /* presented */, |
| 317 uint32 /* sync_point */) { |
315 DCHECK(transport_); | 318 DCHECK(transport_); |
316 helper_->SetScheduled(true); | 319 helper_->SetScheduled(true); |
317 } | 320 } |
318 | 321 |
319 void PassThroughImageTransportSurface::OnResizeViewACK() { | 322 void PassThroughImageTransportSurface::OnResizeViewACK() { |
320 DCHECK(transport_); | 323 DCHECK(transport_); |
321 Resize(new_size_); | 324 Resize(new_size_); |
322 | 325 |
323 helper_->SetScheduled(true); | 326 helper_->SetScheduled(true); |
324 } | 327 } |
(...skipping 11 matching lines...) Expand all Loading... |
336 | 339 |
337 gfx::Size PassThroughImageTransportSurface::GetSize() { | 340 gfx::Size PassThroughImageTransportSurface::GetSize() { |
338 return GLSurfaceAdapter::GetSize(); | 341 return GLSurfaceAdapter::GetSize(); |
339 } | 342 } |
340 | 343 |
341 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} | 344 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} |
342 | 345 |
343 } // namespace content | 346 } // namespace content |
344 | 347 |
345 #endif // defined(ENABLE_GPU) | 348 #endif // defined(ENABLE_GPU) |
OLD | NEW |