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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
11 #include "cc/output/gl_renderer.h" | 11 #include "cc/output/gl_renderer.h" |
12 #include "cc/resources/resource_provider.h" | 12 #include "cc/resources/resource_provider.h" |
13 #include "gpu/GLES2/gl2extchromium.h" | 13 #include "gpu/GLES2/gl2extchromium.h" |
14 #include "gpu/command_buffer/client/gles2_interface.h" | 14 #include "gpu/command_buffer/client/gles2_interface.h" |
15 #include "media/base/video_frame.h" | 15 #include "media/base/video_frame.h" |
16 #include "media/filters/skcanvas_video_renderer.h" | 16 #include "media/filters/skcanvas_video_renderer.h" |
17 #include "third_party/khronos/GLES2/gl2.h" | 17 #include "third_party/khronos/GLES2/gl2.h" |
18 #include "third_party/khronos/GLES2/gl2ext.h" | 18 #include "third_party/khronos/GLES2/gl2ext.h" |
19 #include "ui/gfx/geometry/size_conversions.h" | 19 #include "ui/gfx/geometry/size_conversions.h" |
20 | 20 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 break; | 381 break; |
382 default: | 382 default: |
383 NOTREACHED(); | 383 NOTREACHED(); |
384 return VideoFrameExternalResources(); | 384 return VideoFrameExternalResources(); |
385 } | 385 } |
386 | 386 |
387 external_resources.mailboxes.push_back( | 387 external_resources.mailboxes.push_back( |
388 TextureMailbox(mailbox_holder->mailbox, | 388 TextureMailbox(mailbox_holder->mailbox, |
389 mailbox_holder->texture_target, | 389 mailbox_holder->texture_target, |
390 mailbox_holder->sync_point)); | 390 mailbox_holder->sync_point)); |
| 391 external_resources.mailboxes.back().set_allow_overlay( |
| 392 video_frame->allow_overlay()); |
391 external_resources.release_callbacks.push_back( | 393 external_resources.release_callbacks.push_back( |
392 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); | 394 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); |
393 return external_resources; | 395 return external_resources; |
394 } | 396 } |
395 | 397 |
396 // static | 398 // static |
397 void VideoResourceUpdater::RecycleResource( | 399 void VideoResourceUpdater::RecycleResource( |
398 base::WeakPtr<VideoResourceUpdater> updater, | 400 base::WeakPtr<VideoResourceUpdater> updater, |
399 ResourceProvider::ResourceId resource_id, | 401 ResourceProvider::ResourceId resource_id, |
400 uint32 sync_point, | 402 uint32 sync_point, |
(...skipping 22 matching lines...) Expand all Loading... |
423 resource_it->ref_count = 0; | 425 resource_it->ref_count = 0; |
424 updater->DeleteResource(resource_it); | 426 updater->DeleteResource(resource_it); |
425 return; | 427 return; |
426 } | 428 } |
427 | 429 |
428 --resource_it->ref_count; | 430 --resource_it->ref_count; |
429 DCHECK_GE(resource_it->ref_count, 0); | 431 DCHECK_GE(resource_it->ref_count, 0); |
430 } | 432 } |
431 | 433 |
432 } // namespace cc | 434 } // namespace cc |
OLD | NEW |