OLD | NEW |
---|---|
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" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 void drawYUVVideoQuad(const DrawingFrame&, const YUVVideoDrawQuad*); | 110 void drawYUVVideoQuad(const DrawingFrame&, const YUVVideoDrawQuad*); |
111 | 111 |
112 void setShaderOpacity(float opacity, int alphaLocation); | 112 void setShaderOpacity(float opacity, int alphaLocation); |
113 void setShaderQuadF(const gfx::QuadF&, int quadLocation); | 113 void setShaderQuadF(const gfx::QuadF&, int quadLocation); |
114 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); |
115 void setBlendEnabled(bool enabled); | 115 void setBlendEnabled(bool enabled); |
116 void setUseProgram(unsigned program); | 116 void setUseProgram(unsigned program); |
117 | 117 |
118 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); |
119 | 119 |
120 // Check if quad needs antialiasing and if so, inflate the quad and fill edg e array for fragment shader. | |
121 // localQuad is set to inflated quad if antialiasing is required, otherwise it is set to the original quad. | |
122 // edge array is filled with inflated quad's edge data if antialiasing is re quired, otherwise it is left unchanged. | |
123 // Returns true if quad requires antialiasing and false otherwise. | |
124 bool setupQuadForAntialiasing(const gfx::Transform& deviceTransform, const D rawQuad* quad, gfx::QuadF* localQuad, float* edge) const; | |
reveman
2013/03/04 20:28:30
Lets have this only modify input parameters when q
ernstm
2013/03/04 22:00:26
Done.
| |
125 | |
120 bool useScopedTexture(DrawingFrame&, const ScopedResource*, const gfx::Rect& viewportRect); | 126 bool useScopedTexture(DrawingFrame&, const ScopedResource*, const gfx::Rect& viewportRect); |
121 | 127 |
122 bool makeContextCurrent(); | 128 bool makeContextCurrent(); |
123 | 129 |
124 bool initializeSharedObjects(); | 130 bool initializeSharedObjects(); |
125 void cleanupSharedObjects(); | 131 void cleanupSharedObjects(); |
126 | 132 |
127 // WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROM IUM implementation. | 133 // WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROM IUM implementation. |
128 virtual void onSwapBuffersComplete() OVERRIDE; | 134 virtual void onSwapBuffersComplete() OVERRIDE; |
129 | 135 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 // Texture shaders. | 169 // Texture shaders. |
164 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexVar yingAlpha> TextureProgram; | 170 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexVar yingAlpha> TextureProgram; |
165 typedef ProgramBinding<VertexShaderPosTexTransformFlip, FragmentShaderRGBATe xVaryingAlpha> TextureProgramFlip; | 171 typedef ProgramBinding<VertexShaderPosTexTransformFlip, FragmentShaderRGBATe xVaryingAlpha> TextureProgramFlip; |
166 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRec tVaryingAlpha> TextureIOSurfaceProgram; | 172 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRec tVaryingAlpha> TextureIOSurfaceProgram; |
167 | 173 |
168 // Video shaders. | 174 // Video shaders. |
169 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderOESImageExt ernal> VideoStreamTextureProgram; | 175 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderOESImageExt ernal> VideoStreamTextureProgram; |
170 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> VideoYUVProgram; | 176 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> VideoYUVProgram; |
171 | 177 |
172 // Special purpose / effects shaders. | 178 // Special purpose / effects shaders. |
173 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> SolidColorProgr am; | 179 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> SolidColorProg ram; |
180 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColorAA> SolidColorPr ogramAA; | |
174 | 181 |
175 const TileProgram* tileProgram(); | 182 const TileProgram* tileProgram(); |
176 const TileProgramOpaque* tileProgramOpaque(); | 183 const TileProgramOpaque* tileProgramOpaque(); |
177 const TileProgramAA* tileProgramAA(); | 184 const TileProgramAA* tileProgramAA(); |
178 const TileProgramSwizzle* tileProgramSwizzle(); | 185 const TileProgramSwizzle* tileProgramSwizzle(); |
179 const TileProgramSwizzleOpaque* tileProgramSwizzleOpaque(); | 186 const TileProgramSwizzleOpaque* tileProgramSwizzleOpaque(); |
180 const TileProgramSwizzleAA* tileProgramSwizzleAA(); | 187 const TileProgramSwizzleAA* tileProgramSwizzleAA(); |
181 const TileCheckerboardProgram* tileCheckerboardProgram(); | 188 const TileCheckerboardProgram* tileCheckerboardProgram(); |
182 | 189 |
183 const RenderPassProgram* renderPassProgram(); | 190 const RenderPassProgram* renderPassProgram(); |
184 const RenderPassProgramAA* renderPassProgramAA(); | 191 const RenderPassProgramAA* renderPassProgramAA(); |
185 const RenderPassMaskProgram* renderPassMaskProgram(); | 192 const RenderPassMaskProgram* renderPassMaskProgram(); |
186 const RenderPassMaskProgramAA* renderPassMaskProgramAA(); | 193 const RenderPassMaskProgramAA* renderPassMaskProgramAA(); |
187 | 194 |
188 const TextureProgram* textureProgram(); | 195 const TextureProgram* textureProgram(); |
189 const TextureProgramFlip* textureProgramFlip(); | 196 const TextureProgramFlip* textureProgramFlip(); |
190 const TextureIOSurfaceProgram* textureIOSurfaceProgram(); | 197 const TextureIOSurfaceProgram* textureIOSurfaceProgram(); |
191 | 198 |
192 const VideoYUVProgram* videoYUVProgram(); | 199 const VideoYUVProgram* videoYUVProgram(); |
193 const VideoStreamTextureProgram* videoStreamTextureProgram(); | 200 const VideoStreamTextureProgram* videoStreamTextureProgram(); |
194 | 201 |
195 const SolidColorProgram* solidColorProgram(); | 202 const SolidColorProgram* solidColorProgram(); |
203 const SolidColorProgramAA* solidColorProgramAA(); | |
196 | 204 |
197 scoped_ptr<TileProgram> m_tileProgram; | 205 scoped_ptr<TileProgram> m_tileProgram; |
198 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque; | 206 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque; |
199 scoped_ptr<TileProgramAA> m_tileProgramAA; | 207 scoped_ptr<TileProgramAA> m_tileProgramAA; |
200 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle; | 208 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle; |
201 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque; | 209 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque; |
202 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA; | 210 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA; |
203 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram; | 211 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram; |
204 | 212 |
205 scoped_ptr<RenderPassProgram> m_renderPassProgram; | 213 scoped_ptr<RenderPassProgram> m_renderPassProgram; |
206 scoped_ptr<RenderPassProgramAA> m_renderPassProgramAA; | 214 scoped_ptr<RenderPassProgramAA> m_renderPassProgramAA; |
207 scoped_ptr<RenderPassMaskProgram> m_renderPassMaskProgram; | 215 scoped_ptr<RenderPassMaskProgram> m_renderPassMaskProgram; |
208 scoped_ptr<RenderPassMaskProgramAA> m_renderPassMaskProgramAA; | 216 scoped_ptr<RenderPassMaskProgramAA> m_renderPassMaskProgramAA; |
209 | 217 |
210 scoped_ptr<TextureProgram> m_textureProgram; | 218 scoped_ptr<TextureProgram> m_textureProgram; |
211 scoped_ptr<TextureProgramFlip> m_textureProgramFlip; | 219 scoped_ptr<TextureProgramFlip> m_textureProgramFlip; |
212 scoped_ptr<TextureIOSurfaceProgram> m_textureIOSurfaceProgram; | 220 scoped_ptr<TextureIOSurfaceProgram> m_textureIOSurfaceProgram; |
213 | 221 |
214 scoped_ptr<VideoYUVProgram> m_videoYUVProgram; | 222 scoped_ptr<VideoYUVProgram> m_videoYUVProgram; |
215 scoped_ptr<VideoStreamTextureProgram> m_videoStreamTextureProgram; | 223 scoped_ptr<VideoStreamTextureProgram> m_videoStreamTextureProgram; |
216 | 224 |
217 scoped_ptr<SolidColorProgram> m_solidColorProgram; | 225 scoped_ptr<SolidColorProgram> m_solidColorProgram; |
226 scoped_ptr<SolidColorProgramAA> m_solidColorProgramAA; | |
218 | 227 |
219 OutputSurface* m_outputSurface; | 228 OutputSurface* m_outputSurface; |
220 WebKit::WebGraphicsContext3D* m_context; | 229 WebKit::WebGraphicsContext3D* m_context; |
221 | 230 |
222 gfx::Rect m_swapBufferRect; | 231 gfx::Rect m_swapBufferRect; |
223 gfx::Rect m_scissorRect; | 232 gfx::Rect m_scissorRect; |
224 bool m_isViewportChanged; | 233 bool m_isViewportChanged; |
225 bool m_isBackbufferDiscarded; | 234 bool m_isBackbufferDiscarded; |
226 bool m_discardBackbufferWhenNotVisible; | 235 bool m_discardBackbufferWhenNotVisible; |
227 bool m_isUsingBindUniform; | 236 bool m_isUsingBindUniform; |
(...skipping 19 matching lines...) Expand all Loading... | |
247 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 256 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
248 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) | 257 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) |
249 #else | 258 #else |
250 #define GLC(context, x) (x) | 259 #define GLC(context, x) (x) |
251 #endif | 260 #endif |
252 | 261 |
253 | 262 |
254 } | 263 } |
255 | 264 |
256 #endif // CC_GL_RENDERER_H_ | 265 #endif // CC_GL_RENDERER_H_ |
OLD | NEW |