| 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" | |
| 19 #include "media/base/media_export.h" | 18 #include "media/base/media_export.h" |
| 20 #include "media/base/timestamp_constants.h" | 19 #include "media/base/timestamp_constants.h" |
| 21 #include "media/base/video_frame.h" | 20 #include "media/base/video_frame.h" |
| 22 #include "media/base/video_rotation.h" | 21 #include "media/base/video_rotation.h" |
| 23 #include "media/filters/context_3d.h" | 22 #include "media/filters/context_3d.h" |
| 24 #include "third_party/skia/include/core/SkImage.h" | 23 #include "third_party/skia/include/core/SkImage.h" |
| 25 #include "third_party/skia/include/core/SkRefCnt.h" | 24 #include "third_party/skia/include/core/SkRefCnt.h" |
| 26 | 25 |
| 27 | 26 |
| 28 namespace gfx { | 27 namespace gfx { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // if the image couldn't be updated. | 163 // if the image couldn't be updated. |
| 165 bool UpdateLastImage(const scoped_refptr<VideoFrame>& video_frame, | 164 bool UpdateLastImage(const scoped_refptr<VideoFrame>& video_frame, |
| 166 const Context3D& context_3d); | 165 const Context3D& context_3d); |
| 167 | 166 |
| 168 // Last image used to draw to the canvas. | 167 // Last image used to draw to the canvas. |
| 169 sk_sp<SkImage> last_image_; | 168 sk_sp<SkImage> last_image_; |
| 170 // Timestamp of the videoframe used to generate |last_image_|. | 169 // Timestamp of the videoframe used to generate |last_image_|. |
| 171 base::TimeDelta last_timestamp_ = media::kNoTimestamp; | 170 base::TimeDelta last_timestamp_ = media::kNoTimestamp; |
| 172 // If |last_image_| is not used for a while, it's deleted to save memory. | 171 // If |last_image_| is not used for a while, it's deleted to save memory. |
| 173 base::DelayTimer last_image_deleting_timer_; | 172 base::DelayTimer last_image_deleting_timer_; |
| 174 // Stable paint image id to provide to draw image calls. | |
| 175 cc::PaintImage::Id renderer_stable_id_; | |
| 176 | 173 |
| 177 // Used for DCHECKs to ensure method calls executed in the correct thread. | 174 // Used for DCHECKs to ensure method calls executed in the correct thread. |
| 178 base::ThreadChecker thread_checker_; | 175 base::ThreadChecker thread_checker_; |
| 179 | 176 |
| 180 // Used for unit test. | 177 // Used for unit test. |
| 181 SkISize last_image_dimensions_for_testing_; | 178 SkISize last_image_dimensions_for_testing_; |
| 182 | 179 |
| 183 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 180 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
| 184 }; | 181 }; |
| 185 | 182 |
| 186 } // namespace media | 183 } // namespace media |
| 187 | 184 |
| 188 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 185 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
| OLD | NEW |