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_OUTPUT_GL_RENDERER_H_ | 5 #ifndef CC_OUTPUT_GL_RENDERER_H_ |
6 #define CC_OUTPUT_GL_RENDERER_H_ | 6 #define CC_OUTPUT_GL_RENDERER_H_ |
7 | 7 |
8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/base/scoped_ptr_vector.h" | 10 #include "cc/base/scoped_ptr_vector.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 FragmentShaderRGBATexVaryingAlpha> TextureProgram; | 257 FragmentShaderRGBATexVaryingAlpha> TextureProgram; |
258 typedef ProgramBinding<VertexShaderPosTexTransform, | 258 typedef ProgramBinding<VertexShaderPosTexTransform, |
259 FragmentShaderRGBATexPremultiplyAlpha> | 259 FragmentShaderRGBATexPremultiplyAlpha> |
260 NonPremultipliedTextureProgram; | 260 NonPremultipliedTextureProgram; |
261 typedef ProgramBinding<VertexShaderPosTexTransform, | 261 typedef ProgramBinding<VertexShaderPosTexTransform, |
262 FragmentShaderTexBackgroundVaryingAlpha> | 262 FragmentShaderTexBackgroundVaryingAlpha> |
263 TextureBackgroundProgram; | 263 TextureBackgroundProgram; |
264 typedef ProgramBinding<VertexShaderPosTexTransform, | 264 typedef ProgramBinding<VertexShaderPosTexTransform, |
265 FragmentShaderTexBackgroundPremultiplyAlpha> | 265 FragmentShaderTexBackgroundPremultiplyAlpha> |
266 NonPremultipliedTextureBackgroundProgram; | 266 NonPremultipliedTextureBackgroundProgram; |
267 typedef ProgramBinding<VertexShaderPosTexTransform, | |
268 FragmentShaderRGBATexRectVaryingAlpha> | |
269 TextureIOSurfaceProgram; | |
270 | 267 |
271 // Render surface shaders. | 268 // Render surface shaders. |
272 typedef ProgramBinding<VertexShaderPosTexTransform, | 269 typedef ProgramBinding<VertexShaderPosTexTransform, |
273 FragmentShaderRGBATexAlpha> RenderPassProgram; | 270 FragmentShaderRGBATexAlpha> RenderPassProgram; |
274 typedef ProgramBinding<VertexShaderPosTexTransform, | 271 typedef ProgramBinding<VertexShaderPosTexTransform, |
275 FragmentShaderRGBATexAlphaMask> RenderPassMaskProgram; | 272 FragmentShaderRGBATexAlphaMask> RenderPassMaskProgram; |
276 typedef ProgramBinding<VertexShaderQuadTexTransformAA, | 273 typedef ProgramBinding<VertexShaderQuadTexTransformAA, |
277 FragmentShaderRGBATexAlphaAA> RenderPassProgramAA; | 274 FragmentShaderRGBATexAlphaAA> RenderPassProgramAA; |
278 typedef ProgramBinding<VertexShaderQuadTexTransformAA, | 275 typedef ProgramBinding<VertexShaderQuadTexTransformAA, |
279 FragmentShaderRGBATexAlphaMaskAA> | 276 FragmentShaderRGBATexAlphaMaskAA> |
280 RenderPassMaskProgramAA; | 277 RenderPassMaskProgramAA; |
281 typedef ProgramBinding<VertexShaderPosTexTransform, | 278 typedef ProgramBinding<VertexShaderPosTexTransform, |
282 FragmentShaderRGBATexColorMatrixAlpha> | 279 FragmentShaderRGBATexColorMatrixAlpha> |
283 RenderPassColorMatrixProgram; | 280 RenderPassColorMatrixProgram; |
284 typedef ProgramBinding<VertexShaderQuadTexTransformAA, | 281 typedef ProgramBinding<VertexShaderQuadTexTransformAA, |
285 FragmentShaderRGBATexAlphaMaskColorMatrixAA> | 282 FragmentShaderRGBATexAlphaMaskColorMatrixAA> |
286 RenderPassMaskColorMatrixProgramAA; | 283 RenderPassMaskColorMatrixProgramAA; |
287 typedef ProgramBinding<VertexShaderQuadTexTransformAA, | 284 typedef ProgramBinding<VertexShaderQuadTexTransformAA, |
288 FragmentShaderRGBATexAlphaColorMatrixAA> | 285 FragmentShaderRGBATexAlphaColorMatrixAA> |
289 RenderPassColorMatrixProgramAA; | 286 RenderPassColorMatrixProgramAA; |
290 typedef ProgramBinding<VertexShaderPosTexTransform, | 287 typedef ProgramBinding<VertexShaderPosTexTransform, |
291 FragmentShaderRGBATexAlphaMaskColorMatrix> | 288 FragmentShaderRGBATexAlphaMaskColorMatrix> |
292 RenderPassMaskColorMatrixProgram; | 289 RenderPassMaskColorMatrixProgram; |
293 | 290 |
294 // Video shaders. | 291 // Video shaders. |
295 typedef ProgramBinding<VertexShaderVideoTransform, | 292 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderRGBATex> |
296 FragmentShaderOESImageExternal> | |
297 VideoStreamTextureProgram; | 293 VideoStreamTextureProgram; |
298 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> | 294 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> |
299 VideoYUVProgram; | 295 VideoYUVProgram; |
300 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVAVideo> | 296 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVAVideo> |
301 VideoYUVAProgram; | 297 VideoYUVAProgram; |
302 | 298 |
303 // Special purpose / effects shaders. | 299 // Special purpose / effects shaders. |
304 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> | 300 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> |
305 DebugBorderProgram; | 301 DebugBorderProgram; |
306 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> | 302 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> |
307 SolidColorProgram; | 303 SolidColorProgram; |
308 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> | 304 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> |
309 SolidColorProgramAA; | 305 SolidColorProgramAA; |
310 | 306 |
311 const TileProgram* GetTileProgram(TexCoordPrecision precision); | 307 const TileProgram* GetTileProgram( |
312 const TileProgramOpaque* GetTileProgramOpaque(TexCoordPrecision precision); | 308 TexCoordPrecision precision, SamplerType sampler); |
313 const TileProgramAA* GetTileProgramAA(TexCoordPrecision precision); | 309 const TileProgramOpaque* GetTileProgramOpaque( |
314 const TileProgramSwizzle* GetTileProgramSwizzle(TexCoordPrecision precision); | 310 TexCoordPrecision precision, SamplerType sampler); |
| 311 const TileProgramAA* GetTileProgramAA( |
| 312 TexCoordPrecision precision, SamplerType sampler); |
| 313 const TileProgramSwizzle* GetTileProgramSwizzle( |
| 314 TexCoordPrecision precision, SamplerType sampler); |
315 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque( | 315 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque( |
316 TexCoordPrecision precision); | 316 TexCoordPrecision precision, SamplerType sampler); |
317 const TileProgramSwizzleAA* GetTileProgramSwizzleAA( | 317 const TileProgramSwizzleAA* GetTileProgramSwizzleAA( |
318 TexCoordPrecision precision); | 318 TexCoordPrecision precision, SamplerType sampler); |
| 319 |
319 const TileCheckerboardProgram* GetTileCheckerboardProgram(); | 320 const TileCheckerboardProgram* GetTileCheckerboardProgram(); |
320 | 321 |
321 const RenderPassProgram* GetRenderPassProgram( | 322 const RenderPassProgram* GetRenderPassProgram( |
322 TexCoordPrecision precision); | 323 TexCoordPrecision precision); |
323 const RenderPassProgramAA* GetRenderPassProgramAA( | 324 const RenderPassProgramAA* GetRenderPassProgramAA( |
324 TexCoordPrecision precision); | 325 TexCoordPrecision precision); |
325 const RenderPassMaskProgram* GetRenderPassMaskProgram( | 326 const RenderPassMaskProgram* GetRenderPassMaskProgram( |
326 TexCoordPrecision precision); | 327 TexCoordPrecision precision); |
327 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA( | 328 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA( |
328 TexCoordPrecision precision); | 329 TexCoordPrecision precision); |
329 const RenderPassColorMatrixProgram* GetRenderPassColorMatrixProgram( | 330 const RenderPassColorMatrixProgram* GetRenderPassColorMatrixProgram( |
330 TexCoordPrecision precision); | 331 TexCoordPrecision precision); |
331 const RenderPassColorMatrixProgramAA* GetRenderPassColorMatrixProgramAA( | 332 const RenderPassColorMatrixProgramAA* GetRenderPassColorMatrixProgramAA( |
332 TexCoordPrecision precision); | 333 TexCoordPrecision precision); |
333 const RenderPassMaskColorMatrixProgram* GetRenderPassMaskColorMatrixProgram( | 334 const RenderPassMaskColorMatrixProgram* GetRenderPassMaskColorMatrixProgram( |
334 TexCoordPrecision precision); | 335 TexCoordPrecision precision); |
335 const RenderPassMaskColorMatrixProgramAA* | 336 const RenderPassMaskColorMatrixProgramAA* |
336 GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision); | 337 GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision); |
337 | 338 |
338 const TextureProgram* GetTextureProgram( | 339 const TextureProgram* GetTextureProgram( |
339 TexCoordPrecision precision); | 340 TexCoordPrecision precision); |
340 const NonPremultipliedTextureProgram* GetNonPremultipliedTextureProgram( | 341 const NonPremultipliedTextureProgram* GetNonPremultipliedTextureProgram( |
341 TexCoordPrecision precision); | 342 TexCoordPrecision precision); |
342 const TextureBackgroundProgram* GetTextureBackgroundProgram( | 343 const TextureBackgroundProgram* GetTextureBackgroundProgram( |
343 TexCoordPrecision precision); | 344 TexCoordPrecision precision); |
344 const NonPremultipliedTextureBackgroundProgram* | 345 const NonPremultipliedTextureBackgroundProgram* |
345 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision); | 346 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision); |
346 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram( | 347 const TextureProgram* GetTextureIOSurfaceProgram( |
347 TexCoordPrecision precision); | 348 TexCoordPrecision precision); |
348 | 349 |
349 const VideoYUVProgram* GetVideoYUVProgram( | 350 const VideoYUVProgram* GetVideoYUVProgram( |
350 TexCoordPrecision precision); | 351 TexCoordPrecision precision); |
351 const VideoYUVAProgram* GetVideoYUVAProgram( | 352 const VideoYUVAProgram* GetVideoYUVAProgram( |
352 TexCoordPrecision precision); | 353 TexCoordPrecision precision); |
353 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( | 354 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( |
354 TexCoordPrecision precision); | 355 TexCoordPrecision precision); |
355 | 356 |
356 const DebugBorderProgram* GetDebugBorderProgram(); | 357 const DebugBorderProgram* GetDebugBorderProgram(); |
357 const SolidColorProgram* GetSolidColorProgram(); | 358 const SolidColorProgram* GetSolidColorProgram(); |
358 const SolidColorProgramAA* GetSolidColorProgramAA(); | 359 const SolidColorProgramAA* GetSolidColorProgramAA(); |
359 | 360 |
360 TileProgram tile_program_; | 361 TileProgram tile_program_[NumTexCoordPrecisions][NumSamplerTypes]; |
361 TileProgramOpaque tile_program_opaque_; | 362 TileProgramOpaque |
362 TileProgramAA tile_program_aa_; | 363 tile_program_opaque_[NumTexCoordPrecisions][NumSamplerTypes]; |
363 TileProgramSwizzle tile_program_swizzle_; | 364 TileProgramAA tile_program_aa_[NumTexCoordPrecisions][NumSamplerTypes]; |
364 TileProgramSwizzleOpaque tile_program_swizzle_opaque_; | 365 TileProgramSwizzle |
365 TileProgramSwizzleAA tile_program_swizzle_aa_; | 366 tile_program_swizzle_[NumTexCoordPrecisions][NumSamplerTypes]; |
| 367 TileProgramSwizzleOpaque |
| 368 tile_program_swizzle_opaque_[NumTexCoordPrecisions][NumSamplerTypes]; |
| 369 TileProgramSwizzleAA |
| 370 tile_program_swizzle_aa_[NumTexCoordPrecisions][NumSamplerTypes]; |
| 371 |
366 TileCheckerboardProgram tile_checkerboard_program_; | 372 TileCheckerboardProgram tile_checkerboard_program_; |
367 | 373 |
368 TileProgram tile_program_highp_; | 374 TextureProgram texture_program_[NumTexCoordPrecisions]; |
369 TileProgramOpaque tile_program_opaque_highp_; | 375 NonPremultipliedTextureProgram |
370 TileProgramAA tile_program_aa_highp_; | 376 nonpremultiplied_texture_program_[NumTexCoordPrecisions]; |
371 TileProgramSwizzle tile_program_swizzle_highp_; | 377 TextureBackgroundProgram texture_background_program_[NumTexCoordPrecisions]; |
372 TileProgramSwizzleOpaque tile_program_swizzle_opaque_highp_; | 378 NonPremultipliedTextureBackgroundProgram |
373 TileProgramSwizzleAA tile_program_swizzle_aa_highp_; | 379 nonpremultiplied_texture_background_program_[NumTexCoordPrecisions]; |
| 380 TextureProgram texture_io_surface_program_[NumTexCoordPrecisions]; |
374 | 381 |
375 TextureProgram texture_program_; | 382 RenderPassProgram render_pass_program_[NumTexCoordPrecisions]; |
376 NonPremultipliedTextureProgram nonpremultiplied_texture_program_; | 383 RenderPassProgramAA render_pass_program_aa_[NumTexCoordPrecisions]; |
377 TextureBackgroundProgram texture_background_program_; | 384 RenderPassMaskProgram render_pass_mask_program_[NumTexCoordPrecisions]; |
378 NonPremultipliedTextureBackgroundProgram | 385 RenderPassMaskProgramAA render_pass_mask_program_aa_[NumTexCoordPrecisions]; |
379 nonpremultiplied_texture_background_program_; | 386 RenderPassColorMatrixProgram |
380 TextureIOSurfaceProgram texture_io_surface_program_; | 387 render_pass_color_matrix_program_[NumTexCoordPrecisions]; |
| 388 RenderPassColorMatrixProgramAA |
| 389 render_pass_color_matrix_program_aa_[NumTexCoordPrecisions]; |
| 390 RenderPassMaskColorMatrixProgram |
| 391 render_pass_mask_color_matrix_program_[NumTexCoordPrecisions]; |
| 392 RenderPassMaskColorMatrixProgramAA |
| 393 render_pass_mask_color_matrix_program_aa_[NumTexCoordPrecisions]; |
381 | 394 |
382 TextureProgram texture_program_highp_; | 395 VideoYUVProgram video_yuv_program_[NumTexCoordPrecisions]; |
383 NonPremultipliedTextureProgram nonpremultiplied_texture_program_highp_; | 396 VideoYUVAProgram video_yuva_program_[NumTexCoordPrecisions]; |
384 TextureBackgroundProgram texture_background_program_highp_; | 397 VideoStreamTextureProgram |
385 NonPremultipliedTextureBackgroundProgram | 398 video_stream_texture_program_[NumTexCoordPrecisions]; |
386 nonpremultiplied_texture_background_program_highp_; | |
387 TextureIOSurfaceProgram texture_io_surface_program_highp_; | |
388 | |
389 RenderPassProgram render_pass_program_; | |
390 RenderPassProgramAA render_pass_program_aa_; | |
391 RenderPassMaskProgram render_pass_mask_program_; | |
392 RenderPassMaskProgramAA render_pass_mask_program_aa_; | |
393 RenderPassColorMatrixProgram render_pass_color_matrix_program_; | |
394 RenderPassColorMatrixProgramAA render_pass_color_matrix_program_aa_; | |
395 RenderPassMaskColorMatrixProgram render_pass_mask_color_matrix_program_; | |
396 RenderPassMaskColorMatrixProgramAA render_pass_mask_color_matrix_program_aa_; | |
397 | |
398 RenderPassProgram render_pass_program_highp_; | |
399 RenderPassProgramAA render_pass_program_aa_highp_; | |
400 RenderPassMaskProgram render_pass_mask_program_highp_; | |
401 RenderPassMaskProgramAA render_pass_mask_program_aa_highp_; | |
402 RenderPassColorMatrixProgram render_pass_color_matrix_program_highp_; | |
403 RenderPassColorMatrixProgramAA render_pass_color_matrix_program_aa_highp_; | |
404 RenderPassMaskColorMatrixProgram render_pass_mask_color_matrix_program_highp_; | |
405 RenderPassMaskColorMatrixProgramAA | |
406 render_pass_mask_color_matrix_program_aa_highp_; | |
407 | |
408 VideoYUVProgram video_yuv_program_; | |
409 VideoYUVAProgram video_yuva_program_; | |
410 VideoStreamTextureProgram video_stream_texture_program_; | |
411 | |
412 VideoYUVProgram video_yuv_program_highp_; | |
413 VideoYUVAProgram video_yuva_program_highp_; | |
414 VideoStreamTextureProgram video_stream_texture_program_highp_; | |
415 | 399 |
416 DebugBorderProgram debug_border_program_; | 400 DebugBorderProgram debug_border_program_; |
417 SolidColorProgram solid_color_program_; | 401 SolidColorProgram solid_color_program_; |
418 SolidColorProgramAA solid_color_program_aa_; | 402 SolidColorProgramAA solid_color_program_aa_; |
419 | 403 |
420 blink::WebGraphicsContext3D* context_; | 404 blink::WebGraphicsContext3D* context_; |
421 gpu::ContextSupport* context_support_; | 405 gpu::ContextSupport* context_support_; |
422 | 406 |
423 skia::RefPtr<GrContext> gr_context_; | 407 skia::RefPtr<GrContext> gr_context_; |
424 skia::RefPtr<SkCanvas> sk_canvas_; | 408 skia::RefPtr<SkCanvas> sk_canvas_; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 444 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
461 #define GLC(context, x) \ | 445 #define GLC(context, x) \ |
462 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 446 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
463 #else | 447 #else |
464 #define GLC(context, x) (x) | 448 #define GLC(context, x) (x) |
465 #endif | 449 #endif |
466 | 450 |
467 } // namespace cc | 451 } // namespace cc |
468 | 452 |
469 #endif // CC_OUTPUT_GL_RENDERER_H_ | 453 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |