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 #include "content/common/gpu/texture_image_transport_surface.h" | 5 #include "content/common/gpu/texture_image_transport_surface.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/common/gpu/gpu_channel.h" | 8 #include "content/common/gpu/gpu_channel.h" |
9 #include "content/common/gpu/gpu_channel_manager.h" | 9 #include "content/common/gpu/gpu_channel_manager.h" |
10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 342 } |
343 | 343 |
344 unsigned TextureImageTransportSurface::GetFormat() { | 344 unsigned TextureImageTransportSurface::GetFormat() { |
345 return parent_stub_ ? parent_stub_->surface()->GetFormat() : 0; | 345 return parent_stub_ ? parent_stub_->surface()->GetFormat() : 0; |
346 } | 346 } |
347 | 347 |
348 void TextureImageTransportSurface::OnNewSurfaceACK( | 348 void TextureImageTransportSurface::OnNewSurfaceACK( |
349 uint64 surface_handle, TransportDIB::Handle /*shm_handle*/) { | 349 uint64 surface_handle, TransportDIB::Handle /*shm_handle*/) { |
350 } | 350 } |
351 | 351 |
352 void TextureImageTransportSurface::OnBuffersSwappedACK() { | 352 void TextureImageTransportSurface::OnBufferPresented() { |
353 if (helper_->MakeCurrent()) { | 353 if (helper_->MakeCurrent()) { |
354 if (textures_[front_].size != textures_[back()].size) { | 354 if (textures_[front_].size != textures_[back()].size) { |
355 CreateBackTexture(textures_[front_].size); | 355 CreateBackTexture(textures_[front_].size); |
356 } else { | 356 } else { |
357 AttachBackTextureToFBO(); | 357 AttachBackTextureToFBO(); |
358 } | 358 } |
359 } | 359 } |
360 | 360 |
361 // Even if MakeCurrent fails, schedule anyway, to trigger the lost context | 361 // Even if MakeCurrent fails, schedule anyway, to trigger the lost context |
362 // logic. | 362 // logic. |
363 helper_->SetScheduled(true); | 363 helper_->SetScheduled(true); |
364 } | 364 } |
365 | 365 |
366 void TextureImageTransportSurface::OnPostSubBufferACK() { | |
367 OnBuffersSwappedACK(); | |
368 } | |
369 | |
370 void TextureImageTransportSurface::OnResizeViewACK() { | 366 void TextureImageTransportSurface::OnResizeViewACK() { |
371 NOTREACHED(); | 367 NOTREACHED(); |
372 } | 368 } |
373 | 369 |
374 void TextureImageTransportSurface::ReleaseBackTexture() { | 370 void TextureImageTransportSurface::ReleaseBackTexture() { |
375 if (!parent_stub_) | 371 if (!parent_stub_) |
376 return; | 372 return; |
377 TextureInfo* info = textures_[back()].info; | 373 TextureInfo* info = textures_[back()].info; |
378 DCHECK(info); | 374 DCHECK(info); |
379 | 375 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 Texture& texture = textures_[i]; | 472 Texture& texture = textures_[i]; |
477 texture.info = NULL; | 473 texture.info = NULL; |
478 if (!texture.sent_to_client) | 474 if (!texture.sent_to_client) |
479 continue; | 475 continue; |
480 GpuHostMsg_AcceleratedSurfaceRelease_Params params; | 476 GpuHostMsg_AcceleratedSurfaceRelease_Params params; |
481 params.identifier = texture.client_id; | 477 params.identifier = texture.client_id; |
482 helper_->SendAcceleratedSurfaceRelease(params); | 478 helper_->SendAcceleratedSurfaceRelease(params); |
483 } | 479 } |
484 parent_stub_ = NULL; | 480 parent_stub_ = NULL; |
485 } | 481 } |
OLD | NEW |