OLD | NEW |
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 float multiplier; | 63 float multiplier; |
64 uint32_t bits_per_channel; | 64 uint32_t bits_per_channel; |
65 | 65 |
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 base::SupportsWeakPtr<VideoResourceUpdater> { | |
75 public: | 74 public: |
76 VideoResourceUpdater(ContextProvider* context_provider, | 75 VideoResourceUpdater(ContextProvider* context_provider, |
77 ResourceProvider* resource_provider, | 76 ResourceProvider* resource_provider, |
78 bool use_stream_video_draw_quad); | 77 bool use_stream_video_draw_quad); |
79 ~VideoResourceUpdater(); | 78 ~VideoResourceUpdater(); |
80 | 79 |
81 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame( | 80 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame( |
82 scoped_refptr<media::VideoFrame> video_frame); | 81 scoped_refptr<media::VideoFrame> video_frame); |
83 | 82 |
84 | 83 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 ContextProvider* context_provider_; | 177 ContextProvider* context_provider_; |
179 ResourceProvider* resource_provider_; | 178 ResourceProvider* resource_provider_; |
180 const bool use_stream_video_draw_quad_; | 179 const bool use_stream_video_draw_quad_; |
181 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; | 180 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; |
182 std::vector<uint8_t> upload_pixels_; | 181 std::vector<uint8_t> upload_pixels_; |
183 | 182 |
184 // 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 |
185 // data transfers. | 184 // data transfers. |
186 ResourceList all_resources_; | 185 ResourceList all_resources_; |
187 | 186 |
| 187 base::WeakPtrFactory<VideoResourceUpdater> weak_ptr_factory_; |
| 188 |
188 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 189 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
189 }; | 190 }; |
190 | 191 |
191 } // namespace cc | 192 } // namespace cc |
192 | 193 |
193 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 194 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
OLD | NEW |