| 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/debug/trace_event.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 break; | 379 break; |
| 380 default: | 380 default: |
| 381 NOTREACHED(); | 381 NOTREACHED(); |
| 382 return VideoFrameExternalResources(); | 382 return VideoFrameExternalResources(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 external_resources.mailboxes.push_back( | 385 external_resources.mailboxes.push_back( |
| 386 TextureMailbox(mailbox_holder->mailbox, | 386 TextureMailbox(mailbox_holder->mailbox, |
| 387 mailbox_holder->texture_target, | 387 mailbox_holder->texture_target, |
| 388 mailbox_holder->sync_point)); | 388 mailbox_holder->sync_point)); |
| 389 external_resources.mailboxes.back().set_allow_overlay( | |
| 390 video_frame->allow_overlay()); | |
| 391 external_resources.release_callbacks.push_back( | 389 external_resources.release_callbacks.push_back( |
| 392 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); | 390 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); |
| 393 return external_resources; | 391 return external_resources; |
| 394 } | 392 } |
| 395 | 393 |
| 396 // static | 394 // static |
| 397 void VideoResourceUpdater::RecycleResource( | 395 void VideoResourceUpdater::RecycleResource( |
| 398 base::WeakPtr<VideoResourceUpdater> updater, | 396 base::WeakPtr<VideoResourceUpdater> updater, |
| 399 ResourceProvider::ResourceId resource_id, | 397 ResourceProvider::ResourceId resource_id, |
| 400 uint32 sync_point, | 398 uint32 sync_point, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 423 resource_it->ref_count = 0; | 421 resource_it->ref_count = 0; |
| 424 updater->DeleteResource(resource_it); | 422 updater->DeleteResource(resource_it); |
| 425 return; | 423 return; |
| 426 } | 424 } |
| 427 | 425 |
| 428 --resource_it->ref_count; | 426 --resource_it->ref_count; |
| 429 DCHECK_GE(resource_it->ref_count, 0); | 427 DCHECK_GE(resource_it->ref_count, 0); |
| 430 } | 428 } |
| 431 | 429 |
| 432 } // namespace cc | 430 } // namespace cc |
| OLD | NEW |