| 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/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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 const gfx::Transform& device_transform, | 209 const gfx::Transform& device_transform, |
| 209 const gfx::QuadF& aa_quad, | 210 const gfx::QuadF& aa_quad, |
| 210 const gfx::QuadF* clip_region); | 211 const gfx::QuadF* clip_region); |
| 211 void DrawContentQuadNoAA(const DrawingFrame* frame, | 212 void DrawContentQuadNoAA(const DrawingFrame* frame, |
| 212 const ContentDrawQuadBase* quad, | 213 const ContentDrawQuadBase* quad, |
| 213 ResourceId resource_id, | 214 ResourceId resource_id, |
| 214 const gfx::QuadF* clip_region); | 215 const gfx::QuadF* clip_region); |
| 215 void DrawYUVVideoQuad(const DrawingFrame* frame, | 216 void DrawYUVVideoQuad(const DrawingFrame* frame, |
| 216 const YUVVideoDrawQuad* quad, | 217 const YUVVideoDrawQuad* quad, |
| 217 const gfx::QuadF* clip_region); | 218 const gfx::QuadF* clip_region); |
| 219 void DrawYVideoQuad(const DrawingFrame* frame, |
| 220 const YVideoDrawQuad* quad, |
| 221 const gfx::QuadF* clip_region); |
| 218 void DrawPictureQuad(const DrawingFrame* frame, | 222 void DrawPictureQuad(const DrawingFrame* frame, |
| 219 const PictureDrawQuad* quad, | 223 const PictureDrawQuad* quad, |
| 220 const gfx::QuadF* clip_region); | 224 const gfx::QuadF* clip_region); |
| 221 | 225 |
| 222 void SetShaderOpacity(float opacity, int alpha_location); | 226 void SetShaderOpacity(float opacity, int alpha_location); |
| 223 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); | 227 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); |
| 224 void DrawQuadGeometryClippedByQuadF(const DrawingFrame* frame, | 228 void DrawQuadGeometryClippedByQuadF(const DrawingFrame* frame, |
| 225 const gfx::Transform& draw_transform, | 229 const gfx::Transform& draw_transform, |
| 226 const gfx::RectF& quad_rect, | 230 const gfx::RectF& quad_rect, |
| 227 const gfx::QuadF& clipping_region_quad, | 231 const gfx::QuadF& clipping_region_quad, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 RenderPassColorMatrixProgramAA; | 343 RenderPassColorMatrixProgramAA; |
| 340 typedef ProgramBinding<VertexShaderPosTexTransform, | 344 typedef ProgramBinding<VertexShaderPosTexTransform, |
| 341 FragmentShaderRGBATexAlphaMaskColorMatrix> | 345 FragmentShaderRGBATexAlphaMaskColorMatrix> |
| 342 RenderPassMaskColorMatrixProgram; | 346 RenderPassMaskColorMatrixProgram; |
| 343 | 347 |
| 344 // Video shaders. | 348 // Video shaders. |
| 345 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderRGBATex> | 349 typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderRGBATex> |
| 346 VideoStreamTextureProgram; | 350 VideoStreamTextureProgram; |
| 347 typedef ProgramBinding<VertexShaderPosTexYUVStretchOffset, | 351 typedef ProgramBinding<VertexShaderPosTexYUVStretchOffset, |
| 348 FragmentShaderYUVVideo> VideoYUVProgram; | 352 FragmentShaderYUVVideo> VideoYUVProgram; |
| 353 typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderYVideo> |
| 354 VideoYProgram; |
| 349 | 355 |
| 350 // Special purpose / effects shaders. | 356 // Special purpose / effects shaders. |
| 351 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> | 357 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> |
| 352 DebugBorderProgram; | 358 DebugBorderProgram; |
| 353 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> | 359 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> |
| 354 SolidColorProgram; | 360 SolidColorProgram; |
| 355 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> | 361 typedef ProgramBinding<VertexShaderQuadAA, FragmentShaderColorAA> |
| 356 SolidColorProgramAA; | 362 SolidColorProgramAA; |
| 357 | 363 |
| 358 const TileProgram* GetTileProgram( | 364 const TileProgram* GetTileProgram( |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 SamplerType sampler); | 415 SamplerType sampler); |
| 410 const NonPremultipliedTextureBackgroundProgram* | 416 const NonPremultipliedTextureBackgroundProgram* |
| 411 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision, | 417 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision, |
| 412 SamplerType sampler); | 418 SamplerType sampler); |
| 413 | 419 |
| 414 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, | 420 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, |
| 415 SamplerType sampler, | 421 SamplerType sampler, |
| 416 bool use_alpha_texture, | 422 bool use_alpha_texture, |
| 417 bool use_nv12, | 423 bool use_nv12, |
| 418 bool use_color_lut); | 424 bool use_color_lut); |
| 425 const VideoYProgram* GetVideoYProgram(TexCoordPrecision precision, |
| 426 SamplerType sampler); |
| 419 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( | 427 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( |
| 420 TexCoordPrecision precision); | 428 TexCoordPrecision precision); |
| 421 | 429 |
| 422 const DebugBorderProgram* GetDebugBorderProgram(); | 430 const DebugBorderProgram* GetDebugBorderProgram(); |
| 423 const SolidColorProgram* GetSolidColorProgram(); | 431 const SolidColorProgram* GetSolidColorProgram(); |
| 424 const SolidColorProgramAA* GetSolidColorProgramAA(); | 432 const SolidColorProgramAA* GetSolidColorProgramAA(); |
| 425 | 433 |
| 426 TileProgram | 434 TileProgram |
| 427 tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1]; | 435 tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1]; |
| 428 TileProgramOpaque | 436 TileProgramOpaque |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 [LAST_BLEND_MODE + 1] | 483 [LAST_BLEND_MODE + 1] |
| 476 [LAST_MASK_VALUE + 1]; | 484 [LAST_MASK_VALUE + 1]; |
| 477 RenderPassMaskColorMatrixProgramAA | 485 RenderPassMaskColorMatrixProgramAA |
| 478 render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1] | 486 render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1] |
| 479 [LAST_SAMPLER_TYPE + 1] | 487 [LAST_SAMPLER_TYPE + 1] |
| 480 [LAST_BLEND_MODE + 1] | 488 [LAST_BLEND_MODE + 1] |
| 481 [LAST_MASK_VALUE + 1]; | 489 [LAST_MASK_VALUE + 1]; |
| 482 | 490 |
| 483 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] | 491 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] |
| 484 [LAST_SAMPLER_TYPE + 1][2][2][2]; | 492 [LAST_SAMPLER_TYPE + 1][2][2][2]; |
| 493 VideoYProgram video_y_program_[LAST_TEX_COORD_PRECISION + 1] |
| 494 [LAST_SAMPLER_TYPE + 1]; |
| 485 VideoStreamTextureProgram | 495 VideoStreamTextureProgram |
| 486 video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1]; | 496 video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1]; |
| 487 | 497 |
| 488 DebugBorderProgram debug_border_program_; | 498 DebugBorderProgram debug_border_program_; |
| 489 SolidColorProgram solid_color_program_; | 499 SolidColorProgram solid_color_program_; |
| 490 SolidColorProgramAA solid_color_program_aa_; | 500 SolidColorProgramAA solid_color_program_aa_; |
| 491 | 501 |
| 492 gpu::gles2::GLES2Interface* gl_; | 502 gpu::gles2::GLES2Interface* gl_; |
| 493 gpu::ContextSupport* context_support_; | 503 gpu::ContextSupport* context_support_; |
| 494 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; | 504 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 bool force_drawing_frame_framebuffer_unflipped_ = false; | 550 bool force_drawing_frame_framebuffer_unflipped_ = false; |
| 541 | 551 |
| 542 BoundGeometry bound_geometry_; | 552 BoundGeometry bound_geometry_; |
| 543 ColorLUTCache color_lut_cache_; | 553 ColorLUTCache color_lut_cache_; |
| 544 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 554 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 545 }; | 555 }; |
| 546 | 556 |
| 547 } // namespace cc | 557 } // namespace cc |
| 548 | 558 |
| 549 #endif // CC_OUTPUT_GL_RENDERER_H_ | 559 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |