Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: cc/gl_renderer.h

Issue 12157002: Adding YUVA support for enabling Alpha Playback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving VP8 Alpha Playback behind its own flag Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 CC_GL_RENDERER_H_ 5 #ifndef CC_GL_RENDERER_H_
6 #define CC_GL_RENDERER_H_ 6 #define CC_GL_RENDERER_H_
7 7
8 #include "cc/cc_export.h" 8 #include "cc/cc_export.h"
9 #include "cc/checkerboard_draw_quad.h" 9 #include "cc/checkerboard_draw_quad.h"
10 #include "cc/debug_border_draw_quad.h" 10 #include "cc/debug_border_draw_quad.h"
11 #include "cc/direct_renderer.h" 11 #include "cc/direct_renderer.h"
12 #include "cc/gl_renderer_draw_cache.h" 12 #include "cc/gl_renderer_draw_cache.h"
13 #include "cc/io_surface_draw_quad.h" 13 #include "cc/io_surface_draw_quad.h"
14 #include "cc/output_surface.h" 14 #include "cc/output_surface.h"
15 #include "cc/render_pass_draw_quad.h" 15 #include "cc/render_pass_draw_quad.h"
16 #include "cc/renderer.h" 16 #include "cc/renderer.h"
17 #include "cc/solid_color_draw_quad.h" 17 #include "cc/solid_color_draw_quad.h"
18 #include "cc/tile_draw_quad.h" 18 #include "cc/tile_draw_quad.h"
19 #include "cc/yuv_video_draw_quad.h" 19 #include "cc/yuv_video_draw_quad.h"
20 #include "cc/yuva_video_draw_quad.h"
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
21 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsMemoryAl location.h" 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsMemoryAl location.h"
22 #include "ui/gfx/quad_f.h" 23 #include "ui/gfx/quad_f.h"
23 24
24 namespace cc { 25 namespace cc {
25 26
26 class ScopedResource; 27 class ScopedResource;
27 class StreamVideoDrawQuad; 28 class StreamVideoDrawQuad;
28 class TextureDrawQuad; 29 class TextureDrawQuad;
29 class GeometryBinding; 30 class GeometryBinding;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 const gfx::Transform& contentsDeviceTransformInverse); 100 const gfx::Transform& contentsDeviceTransformInverse);
100 void drawRenderPassQuad(DrawingFrame&, const RenderPassDrawQuad*); 101 void drawRenderPassQuad(DrawingFrame&, const RenderPassDrawQuad*);
101 void drawSolidColorQuad(const DrawingFrame&, const SolidColorDrawQuad*); 102 void drawSolidColorQuad(const DrawingFrame&, const SolidColorDrawQuad*);
102 void drawStreamVideoQuad(const DrawingFrame&, const StreamVideoDrawQuad*); 103 void drawStreamVideoQuad(const DrawingFrame&, const StreamVideoDrawQuad*);
103 void drawTextureQuad(const DrawingFrame&, const TextureDrawQuad*); 104 void drawTextureQuad(const DrawingFrame&, const TextureDrawQuad*);
104 void enqueueTextureQuad(const DrawingFrame&, const TextureDrawQuad*); 105 void enqueueTextureQuad(const DrawingFrame&, const TextureDrawQuad*);
105 void flushTextureQuadCache(); 106 void flushTextureQuadCache();
106 void drawIOSurfaceQuad(const DrawingFrame&, const IOSurfaceDrawQuad*); 107 void drawIOSurfaceQuad(const DrawingFrame&, const IOSurfaceDrawQuad*);
107 void drawTileQuad(const DrawingFrame&, const TileDrawQuad*); 108 void drawTileQuad(const DrawingFrame&, const TileDrawQuad*);
108 void drawYUVVideoQuad(const DrawingFrame&, const YUVVideoDrawQuad*); 109 void drawYUVVideoQuad(const DrawingFrame&, const YUVVideoDrawQuad*);
110 void drawYUVAVideoQuad(const DrawingFrame&, const YUVAVideoDrawQuad*);
109 111
110 void setShaderOpacity(float opacity, int alphaLocation); 112 void setShaderOpacity(float opacity, int alphaLocation);
111 void setShaderQuadF(const gfx::QuadF&, int quadLocation); 113 void setShaderQuadF(const gfx::QuadF&, int quadLocation);
112 void drawQuadGeometry(const DrawingFrame&, const gfx::Transform& drawTransfo rm, const gfx::RectF& quadRect, int matrixLocation); 114 void drawQuadGeometry(const DrawingFrame&, const gfx::Transform& drawTransfo rm, const gfx::RectF& quadRect, int matrixLocation);
113 void setBlendEnabled(bool enabled); 115 void setBlendEnabled(bool enabled);
114 void setUseProgram(unsigned program); 116 void setUseProgram(unsigned program);
115 117
116 void copyTextureToFramebuffer(const DrawingFrame&, int textureId, const gfx: :Rect&, const gfx::Transform& drawMatrix); 118 void copyTextureToFramebuffer(const DrawingFrame&, int textureId, const gfx: :Rect&, const gfx::Transform& drawMatrix);
117 119
118 bool useScopedTexture(DrawingFrame&, const ScopedResource*, const gfx::Rect& viewportRect); 120 bool useScopedTexture(DrawingFrame&, const ScopedResource*, const gfx::Rect& viewportRect);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaMaskAA> R enderPassMaskProgramAA; 161 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaMaskAA> R enderPassMaskProgramAA;
160 162
161 // Texture shaders. 163 // Texture shaders.
162 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexVar yingAlpha> TextureProgram; 164 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexVar yingAlpha> TextureProgram;
163 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexFli pVaryingAlpha> TextureProgramFlip; 165 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexFli pVaryingAlpha> TextureProgramFlip;
164 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRec tVaryingAlpha> TextureIOSurfaceProgram; 166 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRec tVaryingAlpha> TextureIOSurfaceProgram;
165 167
166 // Video shaders. 168 // Video shaders.
167 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderOESImageExt ernal> VideoStreamTextureProgram; 169 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderOESImageExt ernal> VideoStreamTextureProgram;
168 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> VideoYUVProgram; 170 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> VideoYUVProgram;
171 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVAVideo > VideoYUVAProgram;
169 172
170 // Special purpose / effects shaders. 173 // Special purpose / effects shaders.
171 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> SolidColorProgr am; 174 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> SolidColorProgr am;
172 175
173 const TileProgram* tileProgram(); 176 const TileProgram* tileProgram();
174 const TileProgramOpaque* tileProgramOpaque(); 177 const TileProgramOpaque* tileProgramOpaque();
175 const TileProgramAA* tileProgramAA(); 178 const TileProgramAA* tileProgramAA();
176 const TileProgramSwizzle* tileProgramSwizzle(); 179 const TileProgramSwizzle* tileProgramSwizzle();
177 const TileProgramSwizzleOpaque* tileProgramSwizzleOpaque(); 180 const TileProgramSwizzleOpaque* tileProgramSwizzleOpaque();
178 const TileProgramSwizzleAA* tileProgramSwizzleAA(); 181 const TileProgramSwizzleAA* tileProgramSwizzleAA();
179 const TileCheckerboardProgram* tileCheckerboardProgram(); 182 const TileCheckerboardProgram* tileCheckerboardProgram();
180 183
181 const RenderPassProgram* renderPassProgram(); 184 const RenderPassProgram* renderPassProgram();
182 const RenderPassProgramAA* renderPassProgramAA(); 185 const RenderPassProgramAA* renderPassProgramAA();
183 const RenderPassMaskProgram* renderPassMaskProgram(); 186 const RenderPassMaskProgram* renderPassMaskProgram();
184 const RenderPassMaskProgramAA* renderPassMaskProgramAA(); 187 const RenderPassMaskProgramAA* renderPassMaskProgramAA();
185 188
186 const TextureProgram* textureProgram(); 189 const TextureProgram* textureProgram();
187 const TextureProgramFlip* textureProgramFlip(); 190 const TextureProgramFlip* textureProgramFlip();
188 const TextureIOSurfaceProgram* textureIOSurfaceProgram(); 191 const TextureIOSurfaceProgram* textureIOSurfaceProgram();
189 192
190 const VideoYUVProgram* videoYUVProgram(); 193 const VideoYUVProgram* videoYUVProgram();
194 const VideoYUVAProgram* videoYUVAProgram();
191 const VideoStreamTextureProgram* videoStreamTextureProgram(); 195 const VideoStreamTextureProgram* videoStreamTextureProgram();
192 196
193 const SolidColorProgram* solidColorProgram(); 197 const SolidColorProgram* solidColorProgram();
194 198
195 scoped_ptr<TileProgram> m_tileProgram; 199 scoped_ptr<TileProgram> m_tileProgram;
196 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque; 200 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque;
197 scoped_ptr<TileProgramAA> m_tileProgramAA; 201 scoped_ptr<TileProgramAA> m_tileProgramAA;
198 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle; 202 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle;
199 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque; 203 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque;
200 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA; 204 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA;
201 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram; 205 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram;
202 206
203 scoped_ptr<RenderPassProgram> m_renderPassProgram; 207 scoped_ptr<RenderPassProgram> m_renderPassProgram;
204 scoped_ptr<RenderPassProgramAA> m_renderPassProgramAA; 208 scoped_ptr<RenderPassProgramAA> m_renderPassProgramAA;
205 scoped_ptr<RenderPassMaskProgram> m_renderPassMaskProgram; 209 scoped_ptr<RenderPassMaskProgram> m_renderPassMaskProgram;
206 scoped_ptr<RenderPassMaskProgramAA> m_renderPassMaskProgramAA; 210 scoped_ptr<RenderPassMaskProgramAA> m_renderPassMaskProgramAA;
207 211
208 scoped_ptr<TextureProgram> m_textureProgram; 212 scoped_ptr<TextureProgram> m_textureProgram;
209 scoped_ptr<TextureProgramFlip> m_textureProgramFlip; 213 scoped_ptr<TextureProgramFlip> m_textureProgramFlip;
210 scoped_ptr<TextureIOSurfaceProgram> m_textureIOSurfaceProgram; 214 scoped_ptr<TextureIOSurfaceProgram> m_textureIOSurfaceProgram;
211 215
212 scoped_ptr<VideoYUVProgram> m_videoYUVProgram; 216 scoped_ptr<VideoYUVProgram> m_videoYUVProgram;
217 scoped_ptr<VideoYUVAProgram> m_videoYUVAProgram;
213 scoped_ptr<VideoStreamTextureProgram> m_videoStreamTextureProgram; 218 scoped_ptr<VideoStreamTextureProgram> m_videoStreamTextureProgram;
214 219
215 scoped_ptr<SolidColorProgram> m_solidColorProgram; 220 scoped_ptr<SolidColorProgram> m_solidColorProgram;
216 221
217 OutputSurface* m_outputSurface; 222 OutputSurface* m_outputSurface;
218 WebKit::WebGraphicsContext3D* m_context; 223 WebKit::WebGraphicsContext3D* m_context;
219 224
220 gfx::Rect m_swapBufferRect; 225 gfx::Rect m_swapBufferRect;
221 gfx::Rect m_scissorRect; 226 gfx::Rect m_scissorRect;
222 bool m_isViewportChanged; 227 bool m_isViewportChanged;
(...skipping 20 matching lines...) Expand all
243 #if DEBUG_GL_CALLS && !defined(NDEBUG) 248 #if DEBUG_GL_CALLS && !defined(NDEBUG)
244 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) 249 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__))
245 #else 250 #else
246 #define GLC(context, x) (x) 251 #define GLC(context, x) (x)
247 #endif 252 #endif
248 253
249 254
250 } 255 }
251 256
252 #endif // CC_GL_RENDERER_H_ 257 #endif // CC_GL_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698