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

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

Issue 2763223003: Reland of cc: Don't use StreamVideoDrawQuad on any platform but Android. (Closed)
Patch Set: Fix tests. Created 3 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
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/resources/video_resource_updater.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 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 5 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 VideoFrameExternalResources(); 66 VideoFrameExternalResources();
67 VideoFrameExternalResources(const VideoFrameExternalResources& other); 67 VideoFrameExternalResources(const VideoFrameExternalResources& other);
68 ~VideoFrameExternalResources(); 68 ~VideoFrameExternalResources();
69 }; 69 };
70 70
71 // VideoResourceUpdater is used by the video system to produce frame content as 71 // VideoResourceUpdater is used by the video system to produce frame content as
72 // resources consumable by the compositor. 72 // resources consumable by the compositor.
73 class CC_EXPORT VideoResourceUpdater { 73 class CC_EXPORT VideoResourceUpdater {
74 public: 74 public:
75 VideoResourceUpdater(ContextProvider* context_provider, 75 VideoResourceUpdater(ContextProvider* context_provider,
76 ResourceProvider* resource_provider); 76 ResourceProvider* resource_provider,
77 bool use_stream_video_draw_quad);
77 ~VideoResourceUpdater(); 78 ~VideoResourceUpdater();
78 79
79 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame( 80 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame(
80 scoped_refptr<media::VideoFrame> video_frame); 81 scoped_refptr<media::VideoFrame> video_frame);
81 82
82 83
83 private: 84 private:
84 class PlaneResource { 85 class PlaneResource {
85 public: 86 public:
86 PlaneResource(unsigned resource_id, 87 PlaneResource(unsigned resource_id,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 bool lost_resource, 169 bool lost_resource,
169 BlockingTaskRunner* main_thread_task_runner); 170 BlockingTaskRunner* main_thread_task_runner);
170 static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater, 171 static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater,
171 const scoped_refptr<media::VideoFrame>& video_frame, 172 const scoped_refptr<media::VideoFrame>& video_frame,
172 const gpu::SyncToken& sync_token, 173 const gpu::SyncToken& sync_token,
173 bool lost_resource, 174 bool lost_resource,
174 BlockingTaskRunner* main_thread_task_runner); 175 BlockingTaskRunner* main_thread_task_runner);
175 176
176 ContextProvider* context_provider_; 177 ContextProvider* context_provider_;
177 ResourceProvider* resource_provider_; 178 ResourceProvider* resource_provider_;
179 const bool use_stream_video_draw_quad_;
178 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; 180 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_;
179 std::vector<uint8_t> upload_pixels_; 181 std::vector<uint8_t> upload_pixels_;
180 182
181 // Recycle resources so that we can reduce the number of allocations and 183 // Recycle resources so that we can reduce the number of allocations and
182 // data transfers. 184 // data transfers.
183 ResourceList all_resources_; 185 ResourceList all_resources_;
184 186
185 base::WeakPtrFactory<VideoResourceUpdater> weak_ptr_factory_; 187 base::WeakPtrFactory<VideoResourceUpdater> weak_ptr_factory_;
186 188
187 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); 189 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
188 }; 190 };
189 191
190 } // namespace cc 192 } // namespace cc
191 193
192 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 194 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
OLDNEW
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698