| 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 "media/base/media_export.h" | 18 #include "media/base/media_export.h" |
| 18 #include "media/base/timestamp_constants.h" | 19 #include "media/base/timestamp_constants.h" |
| 19 #include "media/base/video_frame.h" | 20 #include "media/base/video_frame.h" |
| 20 #include "media/base/video_rotation.h" | 21 #include "media/base/video_rotation.h" |
| 21 #include "media/filters/context_3d.h" | 22 #include "media/filters/context_3d.h" |
| 22 #include "third_party/skia/include/core/SkImage.h" | 23 #include "third_party/skia/include/core/SkImage.h" |
| 23 #include "third_party/skia/include/core/SkRefCnt.h" | 24 #include "third_party/skia/include/core/SkRefCnt.h" |
| 24 | 25 |
| 25 | 26 |
| 26 namespace gfx { | 27 namespace gfx { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 38 | 39 |
| 39 // Paints |video_frame| on |canvas|, scaling and rotating the result to fit | 40 // Paints |video_frame| on |canvas|, scaling and rotating the result to fit |
| 40 // dimensions specified by |dest_rect|. | 41 // dimensions specified by |dest_rect|. |
| 41 // If the format of |video_frame| is PIXEL_FORMAT_NATIVE_TEXTURE, |context_3d| | 42 // If the format of |video_frame| is PIXEL_FORMAT_NATIVE_TEXTURE, |context_3d| |
| 42 // must be provided. | 43 // must be provided. |
| 43 // | 44 // |
| 44 // Black will be painted on |canvas| if |video_frame| is null. | 45 // Black will be painted on |canvas| if |video_frame| is null. |
| 45 void Paint(const scoped_refptr<VideoFrame>& video_frame, | 46 void Paint(const scoped_refptr<VideoFrame>& video_frame, |
| 46 cc::PaintCanvas* canvas, | 47 cc::PaintCanvas* canvas, |
| 47 const gfx::RectF& dest_rect, | 48 const gfx::RectF& dest_rect, |
| 48 SkPaint& paint, | 49 cc::PaintFlags& flags, |
| 49 VideoRotation video_rotation, | 50 VideoRotation video_rotation, |
| 50 const Context3D& context_3d); | 51 const Context3D& context_3d); |
| 51 | 52 |
| 52 // Copy |video_frame| on |canvas|. | 53 // Copy |video_frame| on |canvas|. |
| 53 // If the format of |video_frame| is PIXEL_FORMAT_NATIVE_TEXTURE, |context_3d| | 54 // If the format of |video_frame| is PIXEL_FORMAT_NATIVE_TEXTURE, |context_3d| |
| 54 // must be provided. | 55 // must be provided. |
| 55 void Copy(const scoped_refptr<VideoFrame>& video_frame, | 56 void Copy(const scoped_refptr<VideoFrame>& video_frame, |
| 56 cc::PaintCanvas* canvas, | 57 cc::PaintCanvas* canvas, |
| 57 const Context3D& context_3d); | 58 const Context3D& context_3d); |
| 58 | 59 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 154 |
| 154 // Used for unit test. | 155 // Used for unit test. |
| 155 SkISize last_image_dimensions_for_testing_; | 156 SkISize last_image_dimensions_for_testing_; |
| 156 | 157 |
| 157 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 158 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 } // namespace media | 161 } // namespace media |
| 161 | 162 |
| 162 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 163 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
| OLD | NEW |