| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 cc::PaintCanvas* canvas, | 62 cc::PaintCanvas* canvas, |
| 63 const Context3D& context_3d); | 63 const Context3D& context_3d); |
| 64 | 64 |
| 65 // Convert the contents of |video_frame| to raw RGB pixels. |rgb_pixels| | 65 // Convert the contents of |video_frame| to raw RGB pixels. |rgb_pixels| |
| 66 // should point into a buffer large enough to hold as many 32 bit RGBA pixels | 66 // should point into a buffer large enough to hold as many 32 bit RGBA pixels |
| 67 // as are in the visible_rect() area of the frame. | 67 // as are in the visible_rect() area of the frame. |
| 68 static void ConvertVideoFrameToRGBPixels(const media::VideoFrame* video_frame, | 68 static void ConvertVideoFrameToRGBPixels(const media::VideoFrame* video_frame, |
| 69 void* rgb_pixels, | 69 void* rgb_pixels, |
| 70 size_t row_bytes); | 70 size_t row_bytes); |
| 71 | 71 |
| 72 enum SingleFrameCopyMode { | |
| 73 SingleFrameForVideoElementOrCanvas, | |
| 74 SingleFrameForWebGL | |
| 75 }; | |
| 76 | |
| 77 // Copy the contents of texture of |video_frame| to texture |texture|. | 72 // Copy the contents of texture of |video_frame| to texture |texture|. |
| 78 // |level|, |internal_format|, |type| specify target texture |texture|. | 73 // |level|, |internal_format|, |type| specify target texture |texture|. |
| 79 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE. | 74 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE. |
| 80 // |copy_mode| alters how the copy is done, and takes into consideration | 75 // |copy_mode| alters how the copy is done, and takes into consideration |
| 81 // whether the caller will clip the texture to the frame's |visible_rect|, | 76 // whether the caller will clip the texture to the frame's |visible_rect|, |
| 82 // or expects this to be done internally. | 77 // or expects this to be done internally. |
| 83 static void CopyVideoFrameSingleTextureToGLTexture( | 78 static void CopyVideoFrameSingleTextureToGLTexture( |
| 84 gpu::gles2::GLES2Interface* gl, | 79 gpu::gles2::GLES2Interface* gl, |
| 85 VideoFrame* video_frame, | 80 VideoFrame* video_frame, |
| 86 SingleFrameCopyMode copy_mode, | |
| 87 unsigned int target, | 81 unsigned int target, |
| 88 unsigned int texture, | 82 unsigned int texture, |
| 89 unsigned int internal_format, | 83 unsigned int internal_format, |
| 90 unsigned int format, | 84 unsigned int format, |
| 91 unsigned int type, | 85 unsigned int type, |
| 92 int level, | 86 int level, |
| 93 bool premultiply_alpha, | 87 bool premultiply_alpha, |
| 94 bool flip_y); | 88 bool flip_y); |
| 95 | 89 |
| 96 // Copy the contents of texture of |video_frame| to texture |texture| in | 90 // Copy the contents of texture of |video_frame| to texture |texture| in |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 177 |
| 184 // Used for unit test. | 178 // Used for unit test. |
| 185 SkISize last_image_dimensions_for_testing_; | 179 SkISize last_image_dimensions_for_testing_; |
| 186 | 180 |
| 187 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 181 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
| 188 }; | 182 }; |
| 189 | 183 |
| 190 } // namespace media | 184 } // namespace media |
| 191 | 185 |
| 192 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 186 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
| OLD | NEW |