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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 const gfx::RectF& quad_rect, | 145 const gfx::RectF& quad_rect, |
146 int matrix_location); | 146 int matrix_location); |
147 void SetBlendEnabled(bool enabled); | 147 void SetBlendEnabled(bool enabled); |
148 void SetUseProgram(unsigned program); | 148 void SetUseProgram(unsigned program); |
149 | 149 |
150 void CopyTextureToFramebuffer(const DrawingFrame& frame, | 150 void CopyTextureToFramebuffer(const DrawingFrame& frame, |
151 int texture_id, | 151 int texture_id, |
152 gfx::Rect rect, | 152 gfx::Rect rect, |
153 const gfx::Transform& draw_matrix); | 153 const gfx::Transform& draw_matrix); |
154 | 154 |
| 155 // Check if quad needs antialiasing and if so, inflate the quad and |
| 156 // fill edge array for fragment shader. localQuad is set to |
| 157 // inflated quad if antialiasing is required, otherwise it is left |
| 158 // unchanged. edge array is filled with inflated quad's edge data |
| 159 // if antialiasing is required, otherwise it is left unchanged. |
| 160 // Returns true if quad requires antialiasing and false otherwise. |
| 161 bool SetupQuadForAntialiasing(const gfx::Transform& deviceTransform, |
| 162 const DrawQuad* quad, |
| 163 gfx::QuadF* localQuad, |
| 164 float edge[24]) const; |
| 165 |
155 bool UseScopedTexture(DrawingFrame& frame, | 166 bool UseScopedTexture(DrawingFrame& frame, |
156 const ScopedResource* resource, | 167 const ScopedResource* resource, |
157 gfx::Rect viewport_rect); | 168 gfx::Rect viewport_rect); |
158 | 169 |
159 bool MakeContextCurrent(); | 170 bool MakeContextCurrent(); |
160 | 171 |
161 bool InitializeSharedObjects(); | 172 bool InitializeSharedObjects(); |
162 void CleanupSharedObjects(); | 173 void CleanupSharedObjects(); |
163 | 174 |
164 // WebKit:: | 175 // WebKit:: |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 TextureIOSurfaceProgram; | 236 TextureIOSurfaceProgram; |
226 | 237 |
227 // Video shaders. | 238 // Video shaders. |
228 typedef ProgramBinding<VertexShaderVideoTransform, | 239 typedef ProgramBinding<VertexShaderVideoTransform, |
229 FragmentShaderOESImageExternal> | 240 FragmentShaderOESImageExternal> |
230 VideoStreamTextureProgram; | 241 VideoStreamTextureProgram; |
231 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> | 242 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> |
232 VideoYUVProgram; | 243 VideoYUVProgram; |
233 | 244 |
234 // Special purpose / effects shaders. | 245 // Special purpose / effects shaders. |
235 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> | 246 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> |
236 SolidColorProgram; | 247 SolidColorProgram; |
| 248 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColorAA> |
| 249 SolidColorProgramAA; |
237 | 250 |
238 const TileProgram* GetTileProgram(); | 251 const TileProgram* GetTileProgram(); |
239 const TileProgramOpaque* GetTileProgramOpaque(); | 252 const TileProgramOpaque* GetTileProgramOpaque(); |
240 const TileProgramAA* GetTileProgramAA(); | 253 const TileProgramAA* GetTileProgramAA(); |
241 const TileProgramSwizzle* GetTileProgramSwizzle(); | 254 const TileProgramSwizzle* GetTileProgramSwizzle(); |
242 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque(); | 255 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque(); |
243 const TileProgramSwizzleAA* GetTileProgramSwizzleAA(); | 256 const TileProgramSwizzleAA* GetTileProgramSwizzleAA(); |
244 const TileCheckerboardProgram* GetTileCheckerboardProgram(); | 257 const TileCheckerboardProgram* GetTileCheckerboardProgram(); |
245 | 258 |
246 const RenderPassProgram* GetRenderPassProgram(); | 259 const RenderPassProgram* GetRenderPassProgram(); |
247 const RenderPassProgramAA* GetRenderPassProgramAA(); | 260 const RenderPassProgramAA* GetRenderPassProgramAA(); |
248 const RenderPassMaskProgram* GetRenderPassMaskProgram(); | 261 const RenderPassMaskProgram* GetRenderPassMaskProgram(); |
249 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(); | 262 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(); |
250 | 263 |
251 const TextureProgram* GetTextureProgram(); | 264 const TextureProgram* GetTextureProgram(); |
252 const TextureProgramFlip* GetTextureProgramFlip(); | 265 const TextureProgramFlip* GetTextureProgramFlip(); |
253 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(); | 266 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(); |
254 | 267 |
255 const VideoYUVProgram* GetVideoYUVProgram(); | 268 const VideoYUVProgram* GetVideoYUVProgram(); |
256 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(); | 269 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(); |
257 | 270 |
258 const SolidColorProgram* GetSolidColorProgram(); | 271 const SolidColorProgram* GetSolidColorProgram(); |
| 272 const SolidColorProgramAA* GetSolidColorProgramAA(); |
259 | 273 |
260 scoped_ptr<TileProgram> tile_program_; | 274 scoped_ptr<TileProgram> tile_program_; |
261 scoped_ptr<TileProgramOpaque> tile_program_opaque_; | 275 scoped_ptr<TileProgramOpaque> tile_program_opaque_; |
262 scoped_ptr<TileProgramAA> tile_program_aa_; | 276 scoped_ptr<TileProgramAA> tile_program_aa_; |
263 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_; | 277 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_; |
264 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_; | 278 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_; |
265 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_; | 279 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_; |
266 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_; | 280 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_; |
267 | 281 |
268 scoped_ptr<RenderPassProgram> render_pass_program_; | 282 scoped_ptr<RenderPassProgram> render_pass_program_; |
269 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_; | 283 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_; |
270 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_; | 284 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_; |
271 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_; | 285 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_; |
272 | 286 |
273 scoped_ptr<TextureProgram> texture_program_; | 287 scoped_ptr<TextureProgram> texture_program_; |
274 scoped_ptr<TextureProgramFlip> texture_program_flip_; | 288 scoped_ptr<TextureProgramFlip> texture_program_flip_; |
275 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_; | 289 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_; |
276 | 290 |
277 scoped_ptr<VideoYUVProgram> video_yuv_program_; | 291 scoped_ptr<VideoYUVProgram> video_yuv_program_; |
278 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_; | 292 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_; |
279 | 293 |
280 scoped_ptr<SolidColorProgram> solid_color_program_; | 294 scoped_ptr<SolidColorProgram> solid_color_program_; |
| 295 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; |
281 | 296 |
282 OutputSurface* output_surface_; | 297 OutputSurface* output_surface_; |
283 WebKit::WebGraphicsContext3D* context_; | 298 WebKit::WebGraphicsContext3D* context_; |
284 | 299 |
285 gfx::Rect swap_buffer_rect_; | 300 gfx::Rect swap_buffer_rect_; |
286 gfx::Rect scissor_rect_; | 301 gfx::Rect scissor_rect_; |
287 bool is_viewport_changed_; | 302 bool is_viewport_changed_; |
288 bool is_backbuffer_discarded_; | 303 bool is_backbuffer_discarded_; |
289 bool discard_backbuffer_when_not_visible_; | 304 bool discard_backbuffer_when_not_visible_; |
290 bool is_using_bind_uniform_; | 305 bool is_using_bind_uniform_; |
(...skipping 18 matching lines...) Expand all Loading... |
309 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 324 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
310 #define GLC(context, x) \ | 325 #define GLC(context, x) \ |
311 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) | 326 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) |
312 #else | 327 #else |
313 #define GLC(context, x) (x) | 328 #define GLC(context, x) (x) |
314 #endif | 329 #endif |
315 | 330 |
316 } | 331 } |
317 | 332 |
318 #endif // CC_GL_RENDERER_H_ | 333 #endif // CC_GL_RENDERER_H_ |
OLD | NEW |