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 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // In general, We hold the most recently painted frame to increase the | 81 // In general, We hold the most recently painted frame to increase the |
82 // performance for the case that the same frame needs to be painted | 82 // performance for the case that the same frame needs to be painted |
83 // repeatedly. Call this function if you are sure the most recent frame will | 83 // repeatedly. Call this function if you are sure the most recent frame will |
84 // never be painted again, so we can release the resource. | 84 // never be painted again, so we can release the resource. |
85 void ResetCache(); | 85 void ResetCache(); |
86 | 86 |
87 private: | 87 private: |
88 // Last image used to draw to the canvas. | 88 // Last image used to draw to the canvas. |
89 sk_sp<SkImage> last_image_; | 89 sk_sp<SkImage> last_image_; |
90 // Timestamp of the videoframe used to generate |last_image_|. | 90 // Timestamp of the videoframe used to generate |last_image_|. |
91 base::TimeDelta last_timestamp_ = media::kNoTimestamp(); | 91 base::TimeDelta last_timestamp_ = media::kNoTimestamp; |
92 // If |last_image_| is not used for a while, it's deleted to save memory. | 92 // If |last_image_| is not used for a while, it's deleted to save memory. |
93 base::DelayTimer last_image_deleting_timer_; | 93 base::DelayTimer last_image_deleting_timer_; |
94 | 94 |
95 // Used for DCHECKs to ensure method calls executed in the correct thread. | 95 // Used for DCHECKs to ensure method calls executed in the correct thread. |
96 base::ThreadChecker thread_checker_; | 96 base::ThreadChecker thread_checker_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 98 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
99 }; | 99 }; |
100 | 100 |
101 } // namespace media | 101 } // namespace media |
102 | 102 |
103 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 103 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
OLD | NEW |