| 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 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "cc/base/cc_export.h" | 18 #include "cc/base/cc_export.h" |
| 19 #include "cc/base/resource_id.h" |
| 19 #include "cc/resources/release_callback_impl.h" | 20 #include "cc/resources/release_callback_impl.h" |
| 20 #include "cc/resources/resource_format.h" | 21 #include "cc/resources/resource_format.h" |
| 21 #include "cc/resources/texture_mailbox.h" | 22 #include "cc/resources/texture_mailbox.h" |
| 22 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 23 | 24 |
| 24 namespace media { | 25 namespace media { |
| 25 class SkCanvasVideoRenderer; | 26 class SkCanvasVideoRenderer; |
| 26 class VideoFrame; | 27 class VideoFrame; |
| 27 } | 28 } |
| 28 | 29 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, | 136 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, |
| 136 unsigned resource_id, | 137 unsigned resource_id, |
| 137 const gpu::SyncToken& sync_token, | 138 const gpu::SyncToken& sync_token, |
| 138 bool lost_resource, | 139 bool lost_resource, |
| 139 BlockingTaskRunner* main_thread_task_runner); | 140 BlockingTaskRunner* main_thread_task_runner); |
| 140 static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater, | 141 static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater, |
| 141 const scoped_refptr<media::VideoFrame>& video_frame, | 142 const scoped_refptr<media::VideoFrame>& video_frame, |
| 142 const gpu::SyncToken& sync_token, | 143 const gpu::SyncToken& sync_token, |
| 143 bool lost_resource, | 144 bool lost_resource, |
| 144 BlockingTaskRunner* main_thread_task_runner); | 145 BlockingTaskRunner* main_thread_task_runner); |
| 146 static void InvalidateResource(base::WeakPtr<VideoResourceUpdater> updater, |
| 147 ResourceId resource_id); |
| 145 | 148 |
| 146 ContextProvider* context_provider_; | 149 ContextProvider* context_provider_; |
| 147 ResourceProvider* resource_provider_; | 150 ResourceProvider* resource_provider_; |
| 148 scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_; | 151 scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_; |
| 149 std::vector<uint8_t> upload_pixels_; | 152 std::vector<uint8_t> upload_pixels_; |
| 150 | 153 |
| 151 // Recycle resources so that we can reduce the number of allocations and | 154 // Recycle resources so that we can reduce the number of allocations and |
| 152 // data transfers. | 155 // data transfers. |
| 153 ResourceList all_resources_; | 156 ResourceList all_resources_; |
| 154 | 157 |
| 155 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 158 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
| 156 }; | 159 }; |
| 157 | 160 |
| 158 } // namespace cc | 161 } // namespace cc |
| 159 | 162 |
| 160 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 163 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
| OLD | NEW |