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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 base::Bind(&RecycleResource, AsWeakPtr(), recycle_data)); | 304 base::Bind(&RecycleResource, AsWeakPtr(), recycle_data)); |
305 } | 305 } |
306 | 306 |
307 external_resources.type = VideoFrameExternalResources::YUV_RESOURCE; | 307 external_resources.type = VideoFrameExternalResources::YUV_RESOURCE; |
308 return external_resources; | 308 return external_resources; |
309 } | 309 } |
310 | 310 |
311 static void ReturnTexture(const scoped_refptr<media::VideoFrame>& frame, | 311 static void ReturnTexture(const scoped_refptr<media::VideoFrame>& frame, |
312 uint32 sync_point, | 312 uint32 sync_point, |
313 bool lost_resource) { | 313 bool lost_resource) { |
314 frame->mailbox_holder()->sync_point = sync_point; | 314 frame->AppendReleaseSyncPoint(sync_point); |
315 } | 315 } |
316 | 316 |
317 VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes( | 317 VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes( |
318 const scoped_refptr<media::VideoFrame>& video_frame) { | 318 const scoped_refptr<media::VideoFrame>& video_frame) { |
319 media::VideoFrame::Format frame_format = video_frame->format(); | 319 media::VideoFrame::Format frame_format = video_frame->format(); |
320 | 320 |
321 DCHECK_EQ(frame_format, media::VideoFrame::NATIVE_TEXTURE); | 321 DCHECK_EQ(frame_format, media::VideoFrame::NATIVE_TEXTURE); |
322 if (frame_format != media::VideoFrame::NATIVE_TEXTURE) | 322 if (frame_format != media::VideoFrame::NATIVE_TEXTURE) |
323 return VideoFrameExternalResources(); | 323 return VideoFrameExternalResources(); |
324 | 324 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 } | 383 } |
384 | 384 |
385 PlaneResource recycled_resource(data.resource_id, | 385 PlaneResource recycled_resource(data.resource_id, |
386 data.resource_size, | 386 data.resource_size, |
387 data.resource_format, | 387 data.resource_format, |
388 data.mailbox); | 388 data.mailbox); |
389 updater->recycled_resources_.push_back(recycled_resource); | 389 updater->recycled_resources_.push_back(recycled_resource); |
390 } | 390 } |
391 | 391 |
392 } // namespace cc | 392 } // namespace cc |
OLD | NEW |