| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 PlaneResource* plane_resource); | 118 PlaneResource* plane_resource); |
| 119 | 119 |
| 120 // This needs to be a container where iterators can be erased without | 120 // This needs to be a container where iterators can be erased without |
| 121 // invalidating other iterators. | 121 // invalidating other iterators. |
| 122 typedef std::list<PlaneResource> ResourceList; | 122 typedef std::list<PlaneResource> ResourceList; |
| 123 ResourceList::iterator AllocateResource(const gfx::Size& plane_size, | 123 ResourceList::iterator AllocateResource(const gfx::Size& plane_size, |
| 124 ResourceFormat format, | 124 ResourceFormat format, |
| 125 bool has_mailbox, | 125 bool has_mailbox, |
| 126 bool immutable_hint); | 126 bool immutable_hint); |
| 127 void DeleteResource(ResourceList::iterator resource_it); | 127 void DeleteResource(ResourceList::iterator resource_it); |
| 128 ResourceList::iterator RecycleOrAllocateTexture( |
| 129 const gfx::Size& resource_size, |
| 130 ResourceFormat resource_format, |
| 131 bool immutable_hint); |
| 128 bool VerifyFrame(const scoped_refptr<media::VideoFrame>& video_frame); | 132 bool VerifyFrame(const scoped_refptr<media::VideoFrame>& video_frame); |
| 129 void CopyPlaneTexture(const scoped_refptr<media::VideoFrame>& video_frame, | 133 void CopyPlaneTexture(const scoped_refptr<media::VideoFrame>& video_frame, |
| 130 const gpu::MailboxHolder& mailbox_holder, | 134 const gpu::MailboxHolder& mailbox_holder, |
| 131 VideoFrameExternalResources* external_resources); | 135 VideoFrameExternalResources* external_resources); |
| 136 VideoFrameExternalResources CreateRGBTextureForSoftwarePlanes( |
| 137 const scoped_refptr<media::VideoFrame>& video_frame); |
| 132 VideoFrameExternalResources CreateForHardwarePlanes( | 138 VideoFrameExternalResources CreateForHardwarePlanes( |
| 133 const scoped_refptr<media::VideoFrame>& video_frame); | 139 const scoped_refptr<media::VideoFrame>& video_frame); |
| 134 VideoFrameExternalResources CreateForSoftwarePlanes( | 140 VideoFrameExternalResources CreateForSoftwarePlanes( |
| 135 const scoped_refptr<media::VideoFrame>& video_frame); | 141 const scoped_refptr<media::VideoFrame>& video_frame); |
| 136 | 142 |
| 137 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, | 143 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, |
| 138 unsigned resource_id, | 144 unsigned resource_id, |
| 139 const gpu::SyncToken& sync_token, | 145 const gpu::SyncToken& sync_token, |
| 140 bool lost_resource, | 146 bool lost_resource, |
| 141 BlockingTaskRunner* main_thread_task_runner); | 147 BlockingTaskRunner* main_thread_task_runner); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 153 // Recycle resources so that we can reduce the number of allocations and | 159 // Recycle resources so that we can reduce the number of allocations and |
| 154 // data transfers. | 160 // data transfers. |
| 155 ResourceList all_resources_; | 161 ResourceList all_resources_; |
| 156 | 162 |
| 157 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 163 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
| 158 }; | 164 }; |
| 159 | 165 |
| 160 } // namespace cc | 166 } // namespace cc |
| 161 | 167 |
| 162 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 168 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
| OLD | NEW |