| 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/direct_renderer.h" | 15 #include "cc/output/direct_renderer.h" |
| 16 #include "cc/output/gl_renderer_draw_cache.h" | 16 #include "cc/output/gl_renderer_draw_cache.h" |
| 17 #include "cc/output/program_binding.h" | 17 #include "cc/output/program_binding.h" |
| 18 #include "cc/output/renderer.h" | 18 #include "cc/output/renderer.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/gfx/geometry/quad_f.h" | 25 #include "ui/gfx/geometry/quad_f.h" |
| 25 | 26 |
| 26 class SkBitmap; | 27 class SkBitmap; |
| 27 | 28 |
| 28 namespace gpu { | 29 namespace gpu { |
| 29 namespace gles2 { | 30 namespace gles2 { |
| 30 class GLES2Interface; | 31 class GLES2Interface; |
| 31 } | 32 } |
| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 RenderPassColorMatrixProgramAA; | 352 RenderPassColorMatrixProgramAA; |
| 349 typedef ProgramBinding<VertexShaderPosTexTransform, | 353 typedef ProgramBinding<VertexShaderPosTexTransform, |
| 350 FragmentShaderRGBATexAlphaMaskColorMatrix> | 354 FragmentShaderRGBATexAlphaMaskColorMatrix> |
| 351 RenderPassMaskColorMatrixProgram; | 355 RenderPassMaskColorMatrixProgram; |
| 352 | 356 |
| 353 // Video shaders. | 357 // Video shaders. |
| 354 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderRGBATex> | 358 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderRGBATex> |
| 355 VideoStreamTextureProgram; | 359 VideoStreamTextureProgram; |
| 356 typedef ProgramBinding<VertexShaderPosTexYUVStretchOffset, | 360 typedef ProgramBinding<VertexShaderPosTexYUVStretchOffset, |
| 357 FragmentShaderYUVVideo> VideoYUVProgram; | 361 FragmentShaderYUVVideo> VideoYUVProgram; |
| 362 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderYVideo> |
| 363 VideoYProgram; |
| 358 | 364 |
| 359 // Special purpose / effects shaders. | 365 // Special purpose / effects shaders. |
| 360 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> | 366 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> |
| 361 DebugBorderProgram; | 367 DebugBorderProgram; |
| 362 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> | 368 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> |
| 363 SolidColorProgram; | 369 SolidColorProgram; |
| 364 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> | 370 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> |
| 365 SolidColorProgramAA; | 371 SolidColorProgramAA; |
| 366 | 372 |
| 367 const TileProgram* GetTileProgram( | 373 const TileProgram* GetTileProgram( |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 SamplerType sampler); | 424 SamplerType sampler); |
| 419 const NonPremultipliedTextureBackgroundProgram* | 425 const NonPremultipliedTextureBackgroundProgram* |
| 420 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision, | 426 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision, |
| 421 SamplerType sampler); | 427 SamplerType sampler); |
| 422 | 428 |
| 423 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, | 429 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, |
| 424 SamplerType sampler, | 430 SamplerType sampler, |
| 425 bool use_alpha_texture, | 431 bool use_alpha_texture, |
| 426 bool use_nv12, | 432 bool use_nv12, |
| 427 bool use_color_lut); | 433 bool use_color_lut); |
| 434 const VideoYProgram* GetVideoYProgram(TexCoordPrecision precision, |
| 435 SamplerType sampler); |
| 428 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( | 436 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( |
| 429 TexCoordPrecision precision); | 437 TexCoordPrecision precision); |
| 430 | 438 |
| 431 const DebugBorderProgram* GetDebugBorderProgram(); | 439 const DebugBorderProgram* GetDebugBorderProgram(); |
| 432 const SolidColorProgram* GetSolidColorProgram(); | 440 const SolidColorProgram* GetSolidColorProgram(); |
| 433 const SolidColorProgramAA* GetSolidColorProgramAA(); | 441 const SolidColorProgramAA* GetSolidColorProgramAA(); |
| 434 | 442 |
| 435 TileProgram | 443 TileProgram |
| 436 tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1]; | 444 tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1]; |
| 437 TileProgramOpaque | 445 TileProgramOpaque |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 [LAST_BLEND_MODE + 1] | 492 [LAST_BLEND_MODE + 1] |
| 485 [LAST_MASK_VALUE + 1]; | 493 [LAST_MASK_VALUE + 1]; |
| 486 RenderPassMaskColorMatrixProgramAA | 494 RenderPassMaskColorMatrixProgramAA |
| 487 render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1] | 495 render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1] |
| 488 [LAST_SAMPLER_TYPE + 1] | 496 [LAST_SAMPLER_TYPE + 1] |
| 489 [LAST_BLEND_MODE + 1] | 497 [LAST_BLEND_MODE + 1] |
| 490 [LAST_MASK_VALUE + 1]; | 498 [LAST_MASK_VALUE + 1]; |
| 491 | 499 |
| 492 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] | 500 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] |
| 493 [LAST_SAMPLER_TYPE + 1][2][2][2]; | 501 [LAST_SAMPLER_TYPE + 1][2][2][2]; |
| 502 VideoYProgram video_y_program_[LAST_TEX_COORD_PRECISION + 1] |
| 503 [LAST_SAMPLER_TYPE + 1]; |
| 494 VideoStreamTextureProgram | 504 VideoStreamTextureProgram |
| 495 video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1]; | 505 video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1]; |
| 496 | 506 |
| 497 DebugBorderProgram debug_border_program_; | 507 DebugBorderProgram debug_border_program_; |
| 498 SolidColorProgram solid_color_program_; | 508 SolidColorProgram solid_color_program_; |
| 499 SolidColorProgramAA solid_color_program_aa_; | 509 SolidColorProgramAA solid_color_program_aa_; |
| 500 | 510 |
| 501 gpu::gles2::GLES2Interface* gl_; | 511 gpu::gles2::GLES2Interface* gl_; |
| 502 gpu::ContextSupport* context_support_; | 512 gpu::ContextSupport* context_support_; |
| 503 | 513 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 bool force_drawing_frame_framebuffer_unflipped_ = false; | 558 bool force_drawing_frame_framebuffer_unflipped_ = false; |
| 549 | 559 |
| 550 BoundGeometry bound_geometry_; | 560 BoundGeometry bound_geometry_; |
| 551 ColorLUTCache color_lut_cache_; | 561 ColorLUTCache color_lut_cache_; |
| 552 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 562 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 553 }; | 563 }; |
| 554 | 564 |
| 555 } // namespace cc | 565 } // namespace cc |
| 556 | 566 |
| 557 #endif // CC_OUTPUT_GL_RENDERER_H_ | 567 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |