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

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

Issue 2763223003: Reland of cc: Don't use StreamVideoDrawQuad on any platform but Android. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 27 matching lines...) Expand all
38 switch (video_frame->format()) { 38 switch (video_frame->format()) {
39 case media::PIXEL_FORMAT_ARGB: 39 case media::PIXEL_FORMAT_ARGB:
40 case media::PIXEL_FORMAT_XRGB: 40 case media::PIXEL_FORMAT_XRGB:
41 case media::PIXEL_FORMAT_UYVY: 41 case media::PIXEL_FORMAT_UYVY:
42 switch (video_frame->mailbox_holder(0).texture_target) { 42 switch (video_frame->mailbox_holder(0).texture_target) {
43 case GL_TEXTURE_2D: 43 case GL_TEXTURE_2D:
44 return (video_frame->format() == media::PIXEL_FORMAT_XRGB) 44 return (video_frame->format() == media::PIXEL_FORMAT_XRGB)
45 ? VideoFrameExternalResources::RGB_RESOURCE 45 ? VideoFrameExternalResources::RGB_RESOURCE
46 : VideoFrameExternalResources::RGBA_PREMULTIPLIED_RESOURCE; 46 : VideoFrameExternalResources::RGBA_PREMULTIPLIED_RESOURCE;
47 case GL_TEXTURE_EXTERNAL_OES: 47 case GL_TEXTURE_EXTERNAL_OES:
48 return video_frame->metadata()->IsTrue( 48 #if defined(OS_ANDROID)
danakj 2017/03/22 14:44:23 Please don't write OS defines inside cc. They make
danakj 2017/03/22 14:47:04 Oh, this isn't in the layer tree really. Maybe her
49 media::VideoFrameMetadata::COPY_REQUIRED) 49 if (!video_frame->metadata()->IsTrue(
50 ? VideoFrameExternalResources::RGBA_RESOURCE 50 media::VideoFrameMetadata::COPY_REQUIRED))
51 : VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE; 51 return VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE;
52 #endif
53 return VideoFrameExternalResources::RGBA_RESOURCE;
52 case GL_TEXTURE_RECTANGLE_ARB: 54 case GL_TEXTURE_RECTANGLE_ARB:
53 return VideoFrameExternalResources::RGB_RESOURCE; 55 return VideoFrameExternalResources::RGB_RESOURCE;
54 default: 56 default:
55 NOTREACHED(); 57 NOTREACHED();
56 break; 58 break;
57 } 59 }
58 break; 60 break;
59 case media::PIXEL_FORMAT_I420: 61 case media::PIXEL_FORMAT_I420:
60 return VideoFrameExternalResources::YUV_RESOURCE; 62 return VideoFrameExternalResources::YUV_RESOURCE;
61 break; 63 break;
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 if (lost_resource) { 778 if (lost_resource) {
777 resource_it->clear_refs(); 779 resource_it->clear_refs();
778 updater->DeleteResource(resource_it); 780 updater->DeleteResource(resource_it);
779 return; 781 return;
780 } 782 }
781 783
782 resource_it->remove_ref(); 784 resource_it->remove_ref();
783 } 785 }
784 786
785 } // namespace cc 787 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698