| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 bool CopyVideoFrameTexturesToGLTexture( | 85 bool CopyVideoFrameTexturesToGLTexture( |
| 86 const Context3D& context_3d, | 86 const Context3D& context_3d, |
| 87 gpu::gles2::GLES2Interface* destination_gl, | 87 gpu::gles2::GLES2Interface* destination_gl, |
| 88 const scoped_refptr<VideoFrame>& video_frame, | 88 const scoped_refptr<VideoFrame>& video_frame, |
| 89 unsigned int texture, | 89 unsigned int texture, |
| 90 unsigned int internal_format, | 90 unsigned int internal_format, |
| 91 unsigned int type, | 91 unsigned int type, |
| 92 bool premultiply_alpha, | 92 bool premultiply_alpha, |
| 93 bool flip_y); | 93 bool flip_y); |
| 94 | 94 |
| 95 // Converts unsigned 16-bit value to target |format| for Y16 format and |
| 96 // calls WebGL texImage2D. |
| 97 // |level|, |internal_format|, |format|, |type| are WebGL texImage2D |
| 98 // parameters. |
| 99 // Returns false if there is no implementation for given parameters. |
| 100 static bool TexImage2D(unsigned target, |
| 101 gpu::gles2::GLES2Interface* gl, |
| 102 VideoFrame* video_frame, |
| 103 int level, |
| 104 int internalformat, |
| 105 unsigned format, |
| 106 unsigned type, |
| 107 bool flip_y, |
| 108 bool premultiply_alpha); |
| 109 |
| 110 // Converts unsigned 16-bit value to target |format| for Y16 format and |
| 111 // calls WebGL texSubImage2D. |
| 112 // |level|, |format|, |type|, |xoffset| and |yoffset| are texSubImage2D |
| 113 // parameters. |
| 114 // Returns false if there is no implementation for given parameters. |
| 115 static bool TexSubImage2D(unsigned target, |
| 116 gpu::gles2::GLES2Interface* gl, |
| 117 VideoFrame* video_frame, |
| 118 int level, |
| 119 unsigned format, |
| 120 unsigned type, |
| 121 int xoffset, |
| 122 int yoffset, |
| 123 bool flip_y, |
| 124 bool premultiply_alpha); |
| 125 |
| 95 // In general, We hold the most recently painted frame to increase the | 126 // In general, We hold the most recently painted frame to increase the |
| 96 // performance for the case that the same frame needs to be painted | 127 // performance for the case that the same frame needs to be painted |
| 97 // repeatedly. Call this function if you are sure the most recent frame will | 128 // repeatedly. Call this function if you are sure the most recent frame will |
| 98 // never be painted again, so we can release the resource. | 129 // never be painted again, so we can release the resource. |
| 99 void ResetCache(); | 130 void ResetCache(); |
| 100 | 131 |
| 101 void CorrectLastImageDimensions(const SkIRect& visible_rect); | 132 void CorrectLastImageDimensions(const SkIRect& visible_rect); |
| 102 | 133 |
| 103 // Used for unit test. | 134 // Used for unit test. |
| 104 SkISize LastImageDimensionsForTesting(); | 135 SkISize LastImageDimensionsForTesting(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 121 | 152 |
| 122 // Used for unit test. | 153 // Used for unit test. |
| 123 SkISize last_image_dimensions_for_testing_; | 154 SkISize last_image_dimensions_for_testing_; |
| 124 | 155 |
| 125 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); | 156 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); |
| 126 }; | 157 }; |
| 127 | 158 |
| 128 } // namespace media | 159 } // namespace media |
| 129 | 160 |
| 130 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ | 161 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ |
| OLD | NEW |