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

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

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: rebased Created 4 years 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
« no previous file with comments | « cc/resources/transferable_resource.cc ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 media::VideoFrameMetadata::COPY_REQUIRED)) { 761 media::VideoFrameMetadata::COPY_REQUIRED)) {
762 CopyPlaneTexture(video_frame.get(), mailbox_holder, &external_resources); 762 CopyPlaneTexture(video_frame.get(), mailbox_holder, &external_resources);
763 } else { 763 } else {
764 TextureMailbox mailbox(mailbox_holder.mailbox, mailbox_holder.sync_token, 764 TextureMailbox mailbox(mailbox_holder.mailbox, mailbox_holder.sync_token,
765 mailbox_holder.texture_target, 765 mailbox_holder.texture_target,
766 video_frame->coded_size(), 766 video_frame->coded_size(),
767 video_frame->metadata()->IsTrue( 767 video_frame->metadata()->IsTrue(
768 media::VideoFrameMetadata::ALLOW_OVERLAY), 768 media::VideoFrameMetadata::ALLOW_OVERLAY),
769 false); 769 false);
770 mailbox.set_color_space(video_frame->ColorSpace()); 770 mailbox.set_color_space(video_frame->ColorSpace());
771 #if defined(OS_ANDROID)
772 mailbox.set_is_backed_by_surface_texture(video_frame->metadata()->IsTrue(
773 media::VideoFrameMetadata::SURFACE_TEXTURE));
774 mailbox.set_wants_promotion_hint(video_frame->metadata()->IsTrue(
775 media::VideoFrameMetadata::WANTS_PROMOTION_HINT));
776 #endif
771 external_resources.mailboxes.push_back(mailbox); 777 external_resources.mailboxes.push_back(mailbox);
772 external_resources.release_callbacks.push_back( 778 external_resources.release_callbacks.push_back(
773 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame)); 779 base::Bind(&ReturnTexture, AsWeakPtr(), video_frame));
774 } 780 }
775 } 781 }
776 return external_resources; 782 return external_resources;
777 } 783 }
778 784
779 // static 785 // static
780 void VideoResourceUpdater::RecycleResource( 786 void VideoResourceUpdater::RecycleResource(
(...skipping 23 matching lines...) Expand all
804 if (lost_resource) { 810 if (lost_resource) {
805 resource_it->clear_refs(); 811 resource_it->clear_refs();
806 updater->DeleteResource(resource_it); 812 updater->DeleteResource(resource_it);
807 return; 813 return;
808 } 814 }
809 815
810 resource_it->remove_ref(); 816 resource_it->remove_ref();
811 } 817 }
812 818
813 } // namespace cc 819 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/transferable_resource.cc ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698