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