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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 const scoped_refptr<media::VideoFrame>& video_frame); | 73 const scoped_refptr<media::VideoFrame>& video_frame); |
74 | 74 |
75 private: | 75 private: |
76 struct PlaneResource { | 76 struct PlaneResource { |
77 unsigned resource_id; | 77 unsigned resource_id; |
78 gfx::Size resource_size; | 78 gfx::Size resource_size; |
79 ResourceFormat resource_format; | 79 ResourceFormat resource_format; |
80 gpu::Mailbox mailbox; | 80 gpu::Mailbox mailbox; |
81 | 81 |
82 PlaneResource(unsigned resource_id, | 82 PlaneResource(unsigned resource_id, |
83 gfx::Size resource_size, | 83 const gfx::Size& resource_size, |
84 ResourceFormat resource_format, | 84 ResourceFormat resource_format, |
85 gpu::Mailbox mailbox) | 85 gpu::Mailbox mailbox) |
86 : resource_id(resource_id), | 86 : resource_id(resource_id), |
87 resource_size(resource_size), | 87 resource_size(resource_size), |
88 resource_format(resource_format), | 88 resource_format(resource_format), |
89 mailbox(mailbox) {} | 89 mailbox(mailbox) {} |
90 }; | 90 }; |
91 | 91 |
92 void DeleteResource(unsigned resource_id); | 92 void DeleteResource(unsigned resource_id); |
93 bool VerifyFrame(const scoped_refptr<media::VideoFrame>& video_frame); | 93 bool VerifyFrame(const scoped_refptr<media::VideoFrame>& video_frame); |
94 VideoFrameExternalResources CreateForHardwarePlanes( | 94 VideoFrameExternalResources CreateForHardwarePlanes( |
95 const scoped_refptr<media::VideoFrame>& video_frame); | 95 const scoped_refptr<media::VideoFrame>& video_frame); |
96 VideoFrameExternalResources CreateForSoftwarePlanes( | 96 VideoFrameExternalResources CreateForSoftwarePlanes( |
97 const scoped_refptr<media::VideoFrame>& video_frame); | 97 const scoped_refptr<media::VideoFrame>& video_frame); |
98 | 98 |
99 struct RecycleResourceData { | 99 struct RecycleResourceData { |
100 unsigned resource_id; | 100 unsigned resource_id; |
101 gfx::Size resource_size; | 101 const gfx::Size& resource_size; |
Adam Rice
2014/01/28 09:41:31
This object gets stored inside a base::Callback. W
r.kasibhatla
2014/01/28 09:55:00
Aah. Missed one in review. Sorry about that.
prashant.n
2014/01/28 10:33:40
Oops. Sorry for the change. Will put new patch.
| |
102 ResourceFormat resource_format; | 102 ResourceFormat resource_format; |
103 gpu::Mailbox mailbox; | 103 gpu::Mailbox mailbox; |
104 }; | 104 }; |
105 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, | 105 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, |
106 RecycleResourceData data, | 106 RecycleResourceData data, |
107 unsigned sync_point, | 107 unsigned sync_point, |
108 bool lost_resource); | 108 bool lost_resource); |
109 | 109 |
110 ContextProvider* context_provider_; | 110 ContextProvider* context_provider_; |
111 ResourceProvider* resource_provider_; | 111 ResourceProvider* resource_provider_; |
112 scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_; | 112 scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_; |
113 | 113 |
114 std::vector<unsigned> all_resources_; | 114 std::vector<unsigned> all_resources_; |
115 std::vector<PlaneResource> recycled_resources_; | 115 std::vector<PlaneResource> recycled_resources_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 117 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
118 }; | 118 }; |
119 | 119 |
120 } // namespace cc | 120 } // namespace cc |
121 | 121 |
122 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 122 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
OLD | NEW |