OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 5 #ifndef MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
6 #define MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 6 #define MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "cc/paint/paint_canvas.h" | 16 #include "cc/paint/paint_canvas.h" |
17 #include "cc/paint/paint_flags.h" | 17 #include "cc/paint/paint_flags.h" |
| 18 #include "cc/paint/paint_image.h" |
18 #include "media/base/media_export.h" | 19 #include "media/base/media_export.h" |
19 #include "media/base/timestamp_constants.h" | 20 #include "media/base/timestamp_constants.h" |
20 #include "media/base/video_frame.h" | 21 #include "media/base/video_frame.h" |
21 #include "media/base/video_rotation.h" | 22 #include "media/base/video_rotation.h" |
22 #include "media/filters/context_3d.h" | 23 #include "media/filters/context_3d.h" |
23 #include "third_party/skia/include/core/SkImage.h" | 24 #include "third_party/skia/include/core/SkImage.h" |
24 #include "third_party/skia/include/core/SkRefCnt.h" | 25 #include "third_party/skia/include/core/SkRefCnt.h" |
25 | 26 |
26 | 27 |
27 namespace gfx { | 28 namespace gfx { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // if the image couldn't be updated. | 168 // if the image couldn't be updated. |
168 bool UpdateLastImage(const scoped_refptr<VideoFrame>& video_frame, | 169 bool UpdateLastImage(const scoped_refptr<VideoFrame>& video_frame, |
169 const Context3D& context_3d); | 170 const Context3D& context_3d); |
170 | 171 |
171 // Last image used to draw to the canvas. | 172 // Last image used to draw to the canvas. |
172 sk_sp<SkImage> last_image_; | 173 sk_sp<SkImage> last_image_; |
173 // Timestamp of the videoframe used to generate |last_image_|. | 174 // Timestamp of the videoframe used to generate |last_image_|. |
174 base::TimeDelta last_timestamp_ = media::kNoTimestamp; | 175 base::TimeDelta last_timestamp_ = media::kNoTimestamp; |
175 // If |last_image_| is not used for a while, it's deleted to save memory. | 176 // If |last_image_| is not used for a while, it's deleted to save memory. |
176 base::DelayTimer last_image_deleting_timer_; | 177 base::DelayTimer last_image_deleting_timer_; |
| 178 // Stable paint image id to provide to draw image calls. |
| 179 cc::PaintImage::Id renderer_stable_id_; |
177 | 180 |
178 // Used for DCHECKs to ensure method calls executed in the correct thread. | 181 // Used for DCHECKs to ensure method calls executed in the correct thread. |
179 base::ThreadChecker thread_checker_; | 182 base::ThreadChecker thread_checker_; |
180 | 183 |
181 // Used for unit test. | 184 // Used for unit test. |
182 SkISize last_image_dimensions_for_testing_; | 185 SkISize last_image_dimensions_for_testing_; |
183 | 186 |
184 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 187 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
185 }; | 188 }; |
186 | 189 |
187 } // namespace media | 190 } // namespace media |
188 | 191 |
189 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 192 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
OLD | NEW |