| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/resources/video_resource_updater.h" | 5 #include "cc/resources/video_resource_updater.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "cc/output/gl_renderer.h" | 8 #include "cc/output/gl_renderer.h" |
| 9 #include "cc/resources/resource_provider.h" | 9 #include "cc/resources/resource_provider.h" |
| 10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 case GL_TEXTURE_RECTANGLE_ARB: | 317 case GL_TEXTURE_RECTANGLE_ARB: |
| 318 external_resources.type = VideoFrameExternalResources::IO_SURFACE; | 318 external_resources.type = VideoFrameExternalResources::IO_SURFACE; |
| 319 break; | 319 break; |
| 320 default: | 320 default: |
| 321 NOTREACHED(); | 321 NOTREACHED(); |
| 322 return VideoFrameExternalResources(); | 322 return VideoFrameExternalResources(); |
| 323 } | 323 } |
| 324 | 324 |
| 325 external_resources.hardware_resource = | 325 external_resources.hardware_resource = |
| 326 resource_provider_->CreateResourceFromExternalTexture( | 326 resource_provider_->CreateResourceFromExternalTexture( |
| 327 video_frame->texture_target(), |
| 327 video_frame->texture_id()); | 328 video_frame->texture_id()); |
| 328 | 329 |
| 329 TextureMailbox::ReleaseCallback callback_to_return_resource = | 330 TextureMailbox::ReleaseCallback callback_to_return_resource = |
| 330 base::Bind(&ReturnTexture, | 331 base::Bind(&ReturnTexture, |
| 331 base::Unretained(resource_provider_), | 332 base::Unretained(resource_provider_), |
| 332 external_resources.hardware_resource); | 333 external_resources.hardware_resource); |
| 333 external_resources.hardware_release_callback = callback_to_return_resource; | 334 external_resources.hardware_release_callback = callback_to_return_resource; |
| 334 return external_resources; | 335 return external_resources; |
| 335 } | 336 } |
| 336 | 337 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 } | 379 } |
| 379 | 380 |
| 380 PlaneResource recycled_resource(data.resource_id, | 381 PlaneResource recycled_resource(data.resource_id, |
| 381 data.resource_size, | 382 data.resource_size, |
| 382 data.resource_format, | 383 data.resource_format, |
| 383 sync_point); | 384 sync_point); |
| 384 updater->recycled_resources_.push_back(recycled_resource); | 385 updater->recycled_resources_.push_back(recycled_resource); |
| 385 } | 386 } |
| 386 | 387 |
| 387 } // namespace cc | 388 } // namespace cc |
| OLD | NEW |