Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 #include "media/base/video_rotation.h" | 21 #include "media/base/video_rotation.h" |
| 22 #include "media/filters/context_3d.h" | 22 #include "media/filters/context_3d.h" |
| 23 #include "third_party/skia/include/core/SkImage.h" | 23 #include "third_party/skia/include/core/SkImage.h" |
| 24 #include "third_party/skia/include/core/SkRefCnt.h" | 24 #include "third_party/skia/include/core/SkRefCnt.h" |
| 25 | 25 |
| 26 | 26 |
| 27 namespace gfx { | 27 namespace gfx { |
| 28 class RectF; | 28 class RectF; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace gpu { | |
| 32 struct Capabilities; | |
| 33 } | |
| 34 | |
| 31 namespace media { | 35 namespace media { |
| 32 | 36 |
| 33 // TODO(enne): rename to PaintCanvasVideoRenderer | 37 // TODO(enne): rename to PaintCanvasVideoRenderer |
| 34 // Handles rendering of VideoFrames to PaintCanvases. | 38 // Handles rendering of VideoFrames to PaintCanvases. |
| 35 class MEDIA_EXPORT SkCanvasVideoRenderer { | 39 class MEDIA_EXPORT SkCanvasVideoRenderer { |
| 36 public: | 40 public: |
| 37 SkCanvasVideoRenderer(); | 41 SkCanvasVideoRenderer(); |
| 38 ~SkCanvasVideoRenderer(); | 42 ~SkCanvasVideoRenderer(); |
| 39 | 43 |
| 40 // Paints |video_frame| on |canvas|, scaling and rotating the result to fit | 44 // Paints |video_frame| on |canvas|, scaling and rotating the result to fit |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 unsigned int texture, | 97 unsigned int texture, |
| 94 bool premultiply_alpha, | 98 bool premultiply_alpha, |
| 95 bool flip_y); | 99 bool flip_y); |
| 96 | 100 |
| 97 // Converts unsigned 16-bit value to target |format| for Y16 format and | 101 // Converts unsigned 16-bit value to target |format| for Y16 format and |
| 98 // calls WebGL texImage2D. | 102 // calls WebGL texImage2D. |
| 99 // |level|, |internal_format|, |format|, |type| are WebGL texImage2D | 103 // |level|, |internal_format|, |format|, |type| are WebGL texImage2D |
| 100 // parameters. | 104 // parameters. |
| 101 // Returns false if there is no implementation for given parameters. | 105 // Returns false if there is no implementation for given parameters. |
| 102 static bool TexImage2D(unsigned target, | 106 static bool TexImage2D(unsigned target, |
| 107 unsigned texture, | |
|
Ken Russell (switch to Gerrit)
2017/04/20 01:47:07
Please document |texture| -- i.e., if it's the one
aleksandar.stojiljkovic
2017/04/26 13:29:40
Done.
| |
| 103 gpu::gles2::GLES2Interface* gl, | 108 gpu::gles2::GLES2Interface* gl, |
| 109 const gpu::Capabilities& gpu_capabilities, | |
| 104 VideoFrame* video_frame, | 110 VideoFrame* video_frame, |
| 105 int level, | 111 int level, |
| 106 int internalformat, | 112 int internalformat, |
| 107 unsigned format, | 113 unsigned format, |
| 108 unsigned type, | 114 unsigned type, |
| 109 bool flip_y, | 115 bool flip_y, |
| 110 bool premultiply_alpha); | 116 bool premultiply_alpha); |
| 111 | 117 |
| 112 // Converts unsigned 16-bit value to target |format| for Y16 format and | 118 // Converts unsigned 16-bit value to target |format| for Y16 format and |
| 113 // calls WebGL texSubImage2D. | 119 // calls WebGL texSubImage2D. |
| 114 // |level|, |format|, |type|, |xoffset| and |yoffset| are texSubImage2D | 120 // |level|, |format|, |type|, |xoffset| and |yoffset| are texSubImage2D |
| 115 // parameters. | 121 // parameters. |
| 116 // Returns false if there is no implementation for given parameters. | 122 // Returns false if there is no implementation for given parameters. |
| 117 static bool TexSubImage2D(unsigned target, | 123 static bool TexSubImage2D(unsigned target, |
|
Ken Russell (switch to Gerrit)
2017/04/20 01:47:06
Same comment about the naming of this function.
| |
| 118 gpu::gles2::GLES2Interface* gl, | 124 gpu::gles2::GLES2Interface* gl, |
| 119 VideoFrame* video_frame, | 125 VideoFrame* video_frame, |
| 120 int level, | 126 int level, |
| 121 unsigned format, | 127 unsigned format, |
| 122 unsigned type, | 128 unsigned type, |
| 123 int xoffset, | 129 int xoffset, |
| 124 int yoffset, | 130 int yoffset, |
| 125 bool flip_y, | 131 bool flip_y, |
| 126 bool premultiply_alpha); | 132 bool premultiply_alpha); |
| 127 | 133 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 154 | 160 |
| 155 // Used for unit test. | 161 // Used for unit test. |
| 156 SkISize last_image_dimensions_for_testing_; | 162 SkISize last_image_dimensions_for_testing_; |
| 157 | 163 |
| 158 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 164 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
| 159 }; | 165 }; |
| 160 | 166 |
| 161 } // namespace media | 167 } // namespace media |
| 162 | 168 |
| 163 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 169 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
| OLD | NEW |