| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 bool immutable_hint); | 177 bool immutable_hint); |
| 178 void DeleteResource(ResourceList::iterator resource_it); | 178 void DeleteResource(ResourceList::iterator resource_it); |
| 179 void CopyPlaneTexture(media::VideoFrame* video_frame, | 179 void CopyPlaneTexture(media::VideoFrame* video_frame, |
| 180 const gfx::ColorSpace& resource_color_space, | 180 const gfx::ColorSpace& resource_color_space, |
| 181 const gpu::MailboxHolder& mailbox_holder, | 181 const gpu::MailboxHolder& mailbox_holder, |
| 182 VideoFrameExternalResources* external_resources); | 182 VideoFrameExternalResources* external_resources); |
| 183 VideoFrameExternalResources CreateForHardwarePlanes( | 183 VideoFrameExternalResources CreateForHardwarePlanes( |
| 184 scoped_refptr<media::VideoFrame> video_frame); | 184 scoped_refptr<media::VideoFrame> video_frame); |
| 185 VideoFrameExternalResources CreateForSoftwarePlanes( | 185 VideoFrameExternalResources CreateForSoftwarePlanes( |
| 186 scoped_refptr<media::VideoFrame> video_frame); | 186 scoped_refptr<media::VideoFrame> video_frame); |
| 187 gfx::ColorSpace GetColorSpace(media::VideoFrame* video_frame); |
| 187 | 188 |
| 188 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, | 189 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, |
| 189 unsigned resource_id, | 190 unsigned resource_id, |
| 190 const gpu::SyncToken& sync_token, | 191 const gpu::SyncToken& sync_token, |
| 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_; |
| 201 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; | 202 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; |
| 202 std::vector<uint8_t> upload_pixels_; | 203 std::vector<uint8_t> upload_pixels_; |
| 203 | 204 |
| 204 // Recycle resources so that we can reduce the number of allocations and | 205 // Recycle resources so that we can reduce the number of allocations and |
| 205 // data transfers. | 206 // data transfers. |
| 206 ResourceList all_resources_; | 207 ResourceList all_resources_; |
| 207 | 208 |
| 208 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 209 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
| 209 }; | 210 }; |
| 210 | 211 |
| 211 } // namespace cc | 212 } // namespace cc |
| 212 | 213 |
| 213 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 214 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
| OLD | NEW |