| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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: | 74  public: | 
| 75   VideoResourceUpdater(ContextProvider* context_provider, | 75   VideoResourceUpdater(ContextProvider* context_provider, | 
| 76                        ResourceProvider* resource_provider, | 76                        ResourceProvider* resource_provider); | 
| 77                        bool use_stream_video_draw_quad); |  | 
| 78   ~VideoResourceUpdater(); | 77   ~VideoResourceUpdater(); | 
| 79 | 78 | 
| 80   VideoFrameExternalResources CreateExternalResourcesFromVideoFrame( | 79   VideoFrameExternalResources CreateExternalResourcesFromVideoFrame( | 
| 81       scoped_refptr<media::VideoFrame> video_frame); | 80       scoped_refptr<media::VideoFrame> video_frame); | 
| 82 | 81 | 
| 83 | 82 | 
| 84  private: | 83  private: | 
| 85   class PlaneResource { | 84   class PlaneResource { | 
| 86    public: | 85    public: | 
| 87     PlaneResource(unsigned resource_id, | 86     PlaneResource(unsigned resource_id, | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 169                               bool lost_resource, | 168                               bool lost_resource, | 
| 170                               BlockingTaskRunner* main_thread_task_runner); | 169                               BlockingTaskRunner* main_thread_task_runner); | 
| 171   static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater, | 170   static void ReturnTexture(base::WeakPtr<VideoResourceUpdater> updater, | 
| 172                             const scoped_refptr<media::VideoFrame>& video_frame, | 171                             const scoped_refptr<media::VideoFrame>& video_frame, | 
| 173                             const gpu::SyncToken& sync_token, | 172                             const gpu::SyncToken& sync_token, | 
| 174                             bool lost_resource, | 173                             bool lost_resource, | 
| 175                             BlockingTaskRunner* main_thread_task_runner); | 174                             BlockingTaskRunner* main_thread_task_runner); | 
| 176 | 175 | 
| 177   ContextProvider* context_provider_; | 176   ContextProvider* context_provider_; | 
| 178   ResourceProvider* resource_provider_; | 177   ResourceProvider* resource_provider_; | 
| 179   const bool use_stream_video_draw_quad_; |  | 
| 180   std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; | 178   std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; | 
| 181   std::vector<uint8_t> upload_pixels_; | 179   std::vector<uint8_t> upload_pixels_; | 
| 182 | 180 | 
| 183   // Recycle resources so that we can reduce the number of allocations and | 181   // Recycle resources so that we can reduce the number of allocations and | 
| 184   // data transfers. | 182   // data transfers. | 
| 185   ResourceList all_resources_; | 183   ResourceList all_resources_; | 
| 186 | 184 | 
| 187   base::WeakPtrFactory<VideoResourceUpdater> weak_ptr_factory_; | 185   base::WeakPtrFactory<VideoResourceUpdater> weak_ptr_factory_; | 
| 188 | 186 | 
| 189   DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 187   DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 
| 190 }; | 188 }; | 
| 191 | 189 | 
| 192 }  // namespace cc | 190 }  // namespace cc | 
| 193 | 191 | 
| 194 #endif  // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 192 #endif  // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 
| OLD | NEW | 
|---|