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