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 <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/cancelable_callback.h" | 11 #include "base/cancelable_callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 #include "cc/output/color_lut_cache.h" | 14 #include "cc/output/color_lut_cache.h" |
15 #include "cc/output/context_cache_controller.h" | 15 #include "cc/output/context_cache_controller.h" |
16 #include "cc/output/direct_renderer.h" | 16 #include "cc/output/direct_renderer.h" |
17 #include "cc/output/gl_renderer_draw_cache.h" | 17 #include "cc/output/gl_renderer_draw_cache.h" |
18 #include "cc/output/program_binding.h" | 18 #include "cc/output/program_binding.h" |
19 #include "cc/quads/debug_border_draw_quad.h" | 19 #include "cc/quads/debug_border_draw_quad.h" |
20 #include "cc/quads/render_pass_draw_quad.h" | 20 #include "cc/quads/render_pass_draw_quad.h" |
21 #include "cc/quads/solid_color_draw_quad.h" | 21 #include "cc/quads/solid_color_draw_quad.h" |
22 #include "cc/quads/tile_draw_quad.h" | 22 #include "cc/quads/tile_draw_quad.h" |
| 23 #include "cc/quads/y_video_draw_quad.h" |
23 #include "cc/quads/yuv_video_draw_quad.h" | 24 #include "cc/quads/yuv_video_draw_quad.h" |
24 #include "ui/events/latency_info.h" | 25 #include "ui/events/latency_info.h" |
25 #include "ui/gfx/geometry/quad_f.h" | 26 #include "ui/gfx/geometry/quad_f.h" |
26 | 27 |
27 class SkBitmap; | 28 class SkBitmap; |
28 | 29 |
29 namespace gpu { | 30 namespace gpu { |
30 namespace gles2 { | 31 namespace gles2 { |
31 class GLES2Interface; | 32 class GLES2Interface; |
32 } | 33 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const gfx::Transform& device_transform, | 213 const gfx::Transform& device_transform, |
213 const gfx::QuadF& aa_quad, | 214 const gfx::QuadF& aa_quad, |
214 const gfx::QuadF* clip_region); | 215 const gfx::QuadF* clip_region); |
215 void DrawContentQuadNoAA(const DrawingFrame* frame, | 216 void DrawContentQuadNoAA(const DrawingFrame* frame, |
216 const ContentDrawQuadBase* quad, | 217 const ContentDrawQuadBase* quad, |
217 ResourceId resource_id, | 218 ResourceId resource_id, |
218 const gfx::QuadF* clip_region); | 219 const gfx::QuadF* clip_region); |
219 void DrawYUVVideoQuad(const DrawingFrame* frame, | 220 void DrawYUVVideoQuad(const DrawingFrame* frame, |
220 const YUVVideoDrawQuad* quad, | 221 const YUVVideoDrawQuad* quad, |
221 const gfx::QuadF* clip_region); | 222 const gfx::QuadF* clip_region); |
| 223 void DrawYVideoQuad(const DrawingFrame* frame, |
| 224 const YVideoDrawQuad* quad, |
| 225 const gfx::QuadF* clip_region); |
222 void DrawPictureQuad(const DrawingFrame* frame, | 226 void DrawPictureQuad(const DrawingFrame* frame, |
223 const PictureDrawQuad* quad, | 227 const PictureDrawQuad* quad, |
224 const gfx::QuadF* clip_region); | 228 const gfx::QuadF* clip_region); |
225 | 229 |
226 void SetShaderOpacity(float opacity, int alpha_location); | 230 void SetShaderOpacity(float opacity, int alpha_location); |
227 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); | 231 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); |
228 void DrawQuadGeometryClippedByQuadF(const DrawingFrame* frame, | 232 void DrawQuadGeometryClippedByQuadF(const DrawingFrame* frame, |
229 const gfx::Transform& draw_transform, | 233 const gfx::Transform& draw_transform, |
230 const gfx::RectF& quad_rect, | 234 const gfx::RectF& quad_rect, |
231 const gfx::QuadF& clipping_region_quad, | 235 const gfx::QuadF& clipping_region_quad, |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 RenderPassColorMatrixProgramAA; | 347 RenderPassColorMatrixProgramAA; |
344 typedef ProgramBinding<VertexShaderPosTexTransform, | 348 typedef ProgramBinding<VertexShaderPosTexTransform, |
345 FragmentShaderRGBATexAlphaMaskColorMatrix> | 349 FragmentShaderRGBATexAlphaMaskColorMatrix> |
346 RenderPassMaskColorMatrixProgram; | 350 RenderPassMaskColorMatrixProgram; |
347 | 351 |
348 // Video shaders. | 352 // Video shaders. |
349 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderRGBATex> | 353 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderRGBATex> |
350 VideoStreamTextureProgram; | 354 VideoStreamTextureProgram; |
351 typedef ProgramBinding<VertexShaderPosTexYUVStretchOffset, | 355 typedef ProgramBinding<VertexShaderPosTexYUVStretchOffset, |
352 FragmentShaderYUVVideo> VideoYUVProgram; | 356 FragmentShaderYUVVideo> VideoYUVProgram; |
| 357 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderYVideo> |
| 358 VideoYProgram; |
353 | 359 |
354 // Special purpose / effects shaders. | 360 // Special purpose / effects shaders. |
355 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> | 361 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> |
356 DebugBorderProgram; | 362 DebugBorderProgram; |
357 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> | 363 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> |
358 SolidColorProgram; | 364 SolidColorProgram; |
359 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> | 365 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> |
360 SolidColorProgramAA; | 366 SolidColorProgramAA; |
361 | 367 |
362 const TileProgram* GetTileProgram( | 368 const TileProgram* GetTileProgram( |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 SamplerType sampler); | 419 SamplerType sampler); |
414 const NonPremultipliedTextureBackgroundProgram* | 420 const NonPremultipliedTextureBackgroundProgram* |
415 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision, | 421 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision, |
416 SamplerType sampler); | 422 SamplerType sampler); |
417 | 423 |
418 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, | 424 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, |
419 SamplerType sampler, | 425 SamplerType sampler, |
420 bool use_alpha_texture, | 426 bool use_alpha_texture, |
421 bool use_nv12, | 427 bool use_nv12, |
422 bool use_color_lut); | 428 bool use_color_lut); |
| 429 const VideoYProgram* GetVideoYProgram(TexCoordPrecision precision, |
| 430 SamplerType sampler); |
423 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( | 431 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( |
424 TexCoordPrecision precision); | 432 TexCoordPrecision precision); |
425 | 433 |
426 const DebugBorderProgram* GetDebugBorderProgram(); | 434 const DebugBorderProgram* GetDebugBorderProgram(); |
427 const SolidColorProgram* GetSolidColorProgram(); | 435 const SolidColorProgram* GetSolidColorProgram(); |
428 const SolidColorProgramAA* GetSolidColorProgramAA(); | 436 const SolidColorProgramAA* GetSolidColorProgramAA(); |
429 | 437 |
430 TileProgram | 438 TileProgram |
431 tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1]; | 439 tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1]; |
432 TileProgramOpaque | 440 TileProgramOpaque |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 [LAST_BLEND_MODE + 1] | 487 [LAST_BLEND_MODE + 1] |
480 [LAST_MASK_VALUE + 1]; | 488 [LAST_MASK_VALUE + 1]; |
481 RenderPassMaskColorMatrixProgramAA | 489 RenderPassMaskColorMatrixProgramAA |
482 render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1] | 490 render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1] |
483 [LAST_SAMPLER_TYPE + 1] | 491 [LAST_SAMPLER_TYPE + 1] |
484 [LAST_BLEND_MODE + 1] | 492 [LAST_BLEND_MODE + 1] |
485 [LAST_MASK_VALUE + 1]; | 493 [LAST_MASK_VALUE + 1]; |
486 | 494 |
487 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] | 495 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] |
488 [LAST_SAMPLER_TYPE + 1][2][2][2]; | 496 [LAST_SAMPLER_TYPE + 1][2][2][2]; |
| 497 VideoYProgram video_y_program_[LAST_TEX_COORD_PRECISION + 1] |
| 498 [LAST_SAMPLER_TYPE + 1]; |
489 VideoStreamTextureProgram | 499 VideoStreamTextureProgram |
490 video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1]; | 500 video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1]; |
491 | 501 |
492 DebugBorderProgram debug_border_program_; | 502 DebugBorderProgram debug_border_program_; |
493 SolidColorProgram solid_color_program_; | 503 SolidColorProgram solid_color_program_; |
494 SolidColorProgramAA solid_color_program_aa_; | 504 SolidColorProgramAA solid_color_program_aa_; |
495 | 505 |
496 gpu::gles2::GLES2Interface* gl_; | 506 gpu::gles2::GLES2Interface* gl_; |
497 gpu::ContextSupport* context_support_; | 507 gpu::ContextSupport* context_support_; |
498 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; | 508 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 bool force_drawing_frame_framebuffer_unflipped_ = false; | 554 bool force_drawing_frame_framebuffer_unflipped_ = false; |
545 | 555 |
546 BoundGeometry bound_geometry_; | 556 BoundGeometry bound_geometry_; |
547 ColorLUTCache color_lut_cache_; | 557 ColorLUTCache color_lut_cache_; |
548 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 558 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
549 }; | 559 }; |
550 | 560 |
551 } // namespace cc | 561 } // namespace cc |
552 | 562 |
553 #endif // CC_OUTPUT_GL_RENDERER_H_ | 563 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |