Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: cc/resources/video_resource_updater.cc

Issue 1142343008: cc: Rework overlays to not use the ResourceProvider and pass texture size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more tests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 DLOG(ERROR) << "Unsupported Texture format" 410 DLOG(ERROR) << "Unsupported Texture format"
411 << media::VideoFrame::FormatToString(video_frame->format()); 411 << media::VideoFrame::FormatToString(video_frame->format());
412 return external_resources; 412 return external_resources;
413 } 413 }
414 DCHECK_NE(VideoFrameExternalResources::NONE, external_resources.type); 414 DCHECK_NE(VideoFrameExternalResources::NONE, external_resources.type);
415 415
416 for (size_t i = 0; i < textures; ++i) { 416 for (size_t i = 0; i < textures; ++i) {
417 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(i); 417 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(i);
418 external_resources.mailboxes.push_back( 418 external_resources.mailboxes.push_back(
419 TextureMailbox(mailbox_holder.mailbox, mailbox_holder.texture_target, 419 TextureMailbox(mailbox_holder.mailbox, mailbox_holder.texture_target,
420 mailbox_holder.sync_point)); 420 mailbox_holder.sync_point, video_frame->coded_size(),
421 external_resources.mailboxes.back().set_allow_overlay( 421 video_frame->allow_overlay()));
422 video_frame->allow_overlay());
423 external_resources.release_callbacks.push_back( 422 external_resources.release_callbacks.push_back(
424 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); 423 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame));
425 } 424 }
426 return external_resources; 425 return external_resources;
427 } 426 }
428 427
429 // static 428 // static
430 void VideoResourceUpdater::RecycleResource( 429 void VideoResourceUpdater::RecycleResource(
431 base::WeakPtr<VideoResourceUpdater> updater, 430 base::WeakPtr<VideoResourceUpdater> updater,
432 ResourceId resource_id, 431 ResourceId resource_id,
(...skipping 22 matching lines...) Expand all
455 resource_it->ref_count = 0; 454 resource_it->ref_count = 0;
456 updater->DeleteResource(resource_it); 455 updater->DeleteResource(resource_it);
457 return; 456 return;
458 } 457 }
459 458
460 --resource_it->ref_count; 459 --resource_it->ref_count;
461 DCHECK_GE(resource_it->ref_count, 0); 460 DCHECK_GE(resource_it->ref_count, 0);
462 } 461 }
463 462
464 } // namespace cc 463 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698