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, gfx::QuadF* localQuad, | |
danakj
2013/03/14 00:54:25
1 param per line if they don't all fit on a single
ernstm
2013/03/14 17:08:33
Done.
| |
163 float edge[24]) const; | |
164 | |
155 bool UseScopedTexture(DrawingFrame& frame, | 165 bool UseScopedTexture(DrawingFrame& frame, |
156 const ScopedResource* resource, | 166 const ScopedResource* resource, |
157 gfx::Rect viewport_rect); | 167 gfx::Rect viewport_rect); |
158 | 168 |
159 bool MakeContextCurrent(); | 169 bool MakeContextCurrent(); |
160 | 170 |
161 bool InitializeSharedObjects(); | 171 bool InitializeSharedObjects(); |
162 void CleanupSharedObjects(); | 172 void CleanupSharedObjects(); |
163 | 173 |
164 // WebKit:: | 174 // WebKit:: |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 TextureIOSurfaceProgram; | 235 TextureIOSurfaceProgram; |
226 | 236 |
227 // Video shaders. | 237 // Video shaders. |
228 typedef ProgramBinding<VertexShaderVideoTransform, | 238 typedef ProgramBinding<VertexShaderVideoTransform, |
229 FragmentShaderOESImageExternal> | 239 FragmentShaderOESImageExternal> |
230 VideoStreamTextureProgram; | 240 VideoStreamTextureProgram; |
231 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> | 241 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> |
232 VideoYUVProgram; | 242 VideoYUVProgram; |
233 | 243 |
234 // Special purpose / effects shaders. | 244 // Special purpose / effects shaders. |
235 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> | 245 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> |
236 SolidColorProgram; | 246 SolidColorProgram; |
247 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColorAA> | |
248 SolidColorProgramAA; | |
237 | 249 |
238 const TileProgram* GetTileProgram(); | 250 const TileProgram* GetTileProgram(); |
239 const TileProgramOpaque* GetTileProgramOpaque(); | 251 const TileProgramOpaque* GetTileProgramOpaque(); |
240 const TileProgramAA* GetTileProgramAA(); | 252 const TileProgramAA* GetTileProgramAA(); |
241 const TileProgramSwizzle* GetTileProgramSwizzle(); | 253 const TileProgramSwizzle* GetTileProgramSwizzle(); |
242 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque(); | 254 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque(); |
243 const TileProgramSwizzleAA* GetTileProgramSwizzleAA(); | 255 const TileProgramSwizzleAA* GetTileProgramSwizzleAA(); |
244 const TileCheckerboardProgram* GetTileCheckerboardProgram(); | 256 const TileCheckerboardProgram* GetTileCheckerboardProgram(); |
245 | 257 |
246 const RenderPassProgram* GetRenderPassProgram(); | 258 const RenderPassProgram* GetRenderPassProgram(); |
247 const RenderPassProgramAA* GetRenderPassProgramAA(); | 259 const RenderPassProgramAA* GetRenderPassProgramAA(); |
248 const RenderPassMaskProgram* GetRenderPassMaskProgram(); | 260 const RenderPassMaskProgram* GetRenderPassMaskProgram(); |
249 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(); | 261 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(); |
250 | 262 |
251 const TextureProgram* GetTextureProgram(); | 263 const TextureProgram* GetTextureProgram(); |
252 const TextureProgramFlip* GetTextureProgramFlip(); | 264 const TextureProgramFlip* GetTextureProgramFlip(); |
253 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(); | 265 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(); |
254 | 266 |
255 const VideoYUVProgram* GetVideoYUVProgram(); | 267 const VideoYUVProgram* GetVideoYUVProgram(); |
256 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(); | 268 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(); |
257 | 269 |
258 const SolidColorProgram* GetSolidColorProgram(); | 270 const SolidColorProgram* GetSolidColorProgram(); |
271 const SolidColorProgramAA* GetSolidColorProgramAA(); | |
259 | 272 |
260 scoped_ptr<TileProgram> tile_program_; | 273 scoped_ptr<TileProgram> tile_program_; |
261 scoped_ptr<TileProgramOpaque> tile_program_opaque_; | 274 scoped_ptr<TileProgramOpaque> tile_program_opaque_; |
262 scoped_ptr<TileProgramAA> tile_program_aa_; | 275 scoped_ptr<TileProgramAA> tile_program_aa_; |
263 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_; | 276 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_; |
264 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_; | 277 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_; |
265 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_; | 278 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_; |
266 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_; | 279 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_; |
267 | 280 |
268 scoped_ptr<RenderPassProgram> render_pass_program_; | 281 scoped_ptr<RenderPassProgram> render_pass_program_; |
269 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_; | 282 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_; |
270 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_; | 283 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_; |
271 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_; | 284 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_; |
272 | 285 |
273 scoped_ptr<TextureProgram> texture_program_; | 286 scoped_ptr<TextureProgram> texture_program_; |
274 scoped_ptr<TextureProgramFlip> texture_program_flip_; | 287 scoped_ptr<TextureProgramFlip> texture_program_flip_; |
275 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_; | 288 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_; |
276 | 289 |
277 scoped_ptr<VideoYUVProgram> video_yuv_program_; | 290 scoped_ptr<VideoYUVProgram> video_yuv_program_; |
278 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_; | 291 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_; |
279 | 292 |
280 scoped_ptr<SolidColorProgram> solid_color_program_; | 293 scoped_ptr<SolidColorProgram> solid_color_program_; |
294 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; | |
281 | 295 |
282 OutputSurface* output_surface_; | 296 OutputSurface* output_surface_; |
283 WebKit::WebGraphicsContext3D* context_; | 297 WebKit::WebGraphicsContext3D* context_; |
284 | 298 |
285 gfx::Rect swap_buffer_rect_; | 299 gfx::Rect swap_buffer_rect_; |
286 gfx::Rect scissor_rect_; | 300 gfx::Rect scissor_rect_; |
287 bool is_viewport_changed_; | 301 bool is_viewport_changed_; |
288 bool is_backbuffer_discarded_; | 302 bool is_backbuffer_discarded_; |
289 bool discard_backbuffer_when_not_visible_; | 303 bool discard_backbuffer_when_not_visible_; |
290 bool is_using_bind_uniform_; | 304 bool is_using_bind_uniform_; |
(...skipping 18 matching lines...) Expand all Loading... | |
309 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 323 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
310 #define GLC(context, x) \ | 324 #define GLC(context, x) \ |
311 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) | 325 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) |
312 #else | 326 #else |
313 #define GLC(context, x) (x) | 327 #define GLC(context, x) (x) |
314 #endif | 328 #endif |
315 | 329 |
316 } | 330 } |
317 | 331 |
318 #endif // CC_GL_RENDERER_H_ | 332 #endif // CC_GL_RENDERER_H_ |
OLD | NEW |