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

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: Address Dana's comments. Fix unittest. 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
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 base::SupportsWeakPtr<VideoResourceUpdater> { 74 : public base::SupportsWeakPtr<VideoResourceUpdater> {
75 public: 75 public:
76 VideoResourceUpdater(ContextProvider* context_provider, 76 VideoResourceUpdater(ContextProvider* context_provider,
77 ResourceProvider* resource_provider); 77 ResourceProvider* resource_provider,
78 bool use_stream_video_draw_quad = false);
danakj 2017/03/28 15:44:13 i would prefer not to use a default value here, it
Daniele Castagna 2017/03/29 20:38:18 Done.
78 ~VideoResourceUpdater(); 79 ~VideoResourceUpdater();
79 80
80 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame( 81 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame(
81 scoped_refptr<media::VideoFrame> video_frame); 82 scoped_refptr<media::VideoFrame> video_frame);
82 83
83 // Base class for converting short integers to half-floats. 84 // Base class for converting short integers to half-floats.
84 // TODO(hubbe): Move this to media/. 85 // TODO(hubbe): Move this to media/.
85 class HalfFloatMaker { 86 class HalfFloatMaker {
86 public: 87 public:
87 // Convert an array of short integers into an array of half-floats. 88 // Convert an array of short integers into an array of half-floats.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 bool lost_resource, 192 bool lost_resource,
192 BlockingTaskRunner* main_thread_task_runner); 193 BlockingTaskRunner* main_thread_task_runner);
193 static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater, 194 static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater,
194 const scoped_refptr<media::VideoFrame>& video_frame, 195 const scoped_refptr<media::VideoFrame>& video_frame,
195 const gpu::SyncToken& sync_token, 196 const gpu::SyncToken& sync_token,
196 bool lost_resource, 197 bool lost_resource,
197 BlockingTaskRunner* main_thread_task_runner); 198 BlockingTaskRunner* main_thread_task_runner);
198 199
199 ContextProvider* context_provider_; 200 ContextProvider* context_provider_;
200 ResourceProvider* resource_provider_; 201 ResourceProvider* resource_provider_;
202 const bool use_stream_video_draw_quad_;
201 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; 203 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_;
202 std::vector<uint8_t> upload_pixels_; 204 std::vector<uint8_t> upload_pixels_;
203 205
204 // Recycle resources so that we can reduce the number of allocations and 206 // Recycle resources so that we can reduce the number of allocations and
205 // data transfers. 207 // data transfers.
206 ResourceList all_resources_; 208 ResourceList all_resources_;
207 209
208 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); 210 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
209 }; 211 };
210 212
211 } // namespace cc 213 } // namespace cc
212 214
213 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 215 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698