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_deque.h" | 10 #include "cc/base/scoped_ptr_deque.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void PrepareGeometry(BoundGeometry geometry_to_bind); | 101 void PrepareGeometry(BoundGeometry geometry_to_bind); |
102 void SetStencilEnabled(bool enabled); | 102 void SetStencilEnabled(bool enabled); |
103 bool stencil_enabled() const { return stencil_shadow_; } | 103 bool stencil_enabled() const { return stencil_shadow_; } |
104 void SetBlendEnabled(bool enabled); | 104 void SetBlendEnabled(bool enabled); |
105 bool blend_enabled() const { return blend_shadow_; } | 105 bool blend_enabled() const { return blend_shadow_; } |
106 | 106 |
107 void BindFramebufferToOutputSurface(DrawingFrame* frame) override; | 107 void BindFramebufferToOutputSurface(DrawingFrame* frame) override; |
108 bool BindFramebufferToTexture(DrawingFrame* frame, | 108 bool BindFramebufferToTexture(DrawingFrame* frame, |
109 const ScopedResource* resource, | 109 const ScopedResource* resource, |
110 const gfx::Rect& target_rect) override; | 110 const gfx::Rect& target_rect) override; |
111 void SetDrawViewport(const gfx::Rect& window_space_viewport) override; | |
112 void SetScissorTestRect(const gfx::Rect& scissor_rect) override; | 111 void SetScissorTestRect(const gfx::Rect& scissor_rect) override; |
113 void PrepareSurfaceForPass(DrawingFrame* frame, | 112 void PrepareSurfaceForPass(DrawingFrame* frame, |
114 SurfaceInitializationMode initialization_mode, | 113 SurfaceInitializationMode initialization_mode, |
115 const gfx::Rect& render_pass_scissor) override; | 114 const gfx::Rect& render_pass_scissor) override; |
116 void DoDrawQuad(DrawingFrame* frame, | 115 void DoDrawQuad(DrawingFrame* frame, |
117 const class DrawQuad*, | 116 const class DrawQuad*, |
118 const gfx::QuadF* draw_region) override; | 117 const gfx::QuadF* draw_region) override; |
119 void BeginDrawingFrame(DrawingFrame* frame) override; | 118 void BeginDrawingFrame(DrawingFrame* frame) override; |
120 void FinishDrawingFrame(DrawingFrame* frame) override; | 119 void FinishDrawingFrame(DrawingFrame* frame) override; |
121 bool FlippedFramebuffer(const DrawingFrame* frame) const override; | 120 bool FlippedFramebuffer(const DrawingFrame* frame) const override; |
(...skipping 22 matching lines...) Expand all Loading... |
144 float edge[24]); | 143 float edge[24]); |
145 | 144 |
146 private: | 145 private: |
147 friend class GLRendererShaderPixelTest; | 146 friend class GLRendererShaderPixelTest; |
148 friend class GLRendererShaderTest; | 147 friend class GLRendererShaderTest; |
149 | 148 |
150 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform); | 149 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform); |
151 | 150 |
152 void DiscardPixels(); | 151 void DiscardPixels(); |
153 void ClearFramebuffer(DrawingFrame* frame); | 152 void ClearFramebuffer(DrawingFrame* frame); |
| 153 void SetViewport(); |
154 | 154 |
155 void DrawCheckerboardQuad(const DrawingFrame* frame, | 155 void DrawCheckerboardQuad(const DrawingFrame* frame, |
156 const CheckerboardDrawQuad* quad, | 156 const CheckerboardDrawQuad* quad, |
157 const gfx::QuadF* clip_region); | 157 const gfx::QuadF* clip_region); |
158 void DrawDebugBorderQuad(const DrawingFrame* frame, | 158 void DrawDebugBorderQuad(const DrawingFrame* frame, |
159 const DebugBorderDrawQuad* quad); | 159 const DebugBorderDrawQuad* quad); |
160 static bool IsDefaultBlendMode(SkXfermode::Mode blend_mode) { | 160 static bool IsDefaultBlendMode(SkXfermode::Mode blend_mode) { |
161 return blend_mode == SkXfermode::kSrcOver_Mode; | 161 return blend_mode == SkXfermode::kSrcOver_Mode; |
162 } | 162 } |
163 bool CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode); | 163 bool CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 SolidColorProgram solid_color_program_; | 480 SolidColorProgram solid_color_program_; |
481 SolidColorProgramAA solid_color_program_aa_; | 481 SolidColorProgramAA solid_color_program_aa_; |
482 | 482 |
483 gpu::gles2::GLES2Interface* gl_; | 483 gpu::gles2::GLES2Interface* gl_; |
484 gpu::ContextSupport* context_support_; | 484 gpu::ContextSupport* context_support_; |
485 | 485 |
486 TextureMailboxDeleter* texture_mailbox_deleter_; | 486 TextureMailboxDeleter* texture_mailbox_deleter_; |
487 | 487 |
488 gfx::Rect swap_buffer_rect_; | 488 gfx::Rect swap_buffer_rect_; |
489 gfx::Rect scissor_rect_; | 489 gfx::Rect scissor_rect_; |
490 gfx::Rect viewport_; | |
491 bool is_backbuffer_discarded_; | 490 bool is_backbuffer_discarded_; |
492 bool is_using_bind_uniform_; | 491 bool is_using_bind_uniform_; |
493 bool is_scissor_enabled_; | 492 bool is_scissor_enabled_; |
494 bool scissor_rect_needs_reset_; | 493 bool scissor_rect_needs_reset_; |
495 bool stencil_shadow_; | 494 bool stencil_shadow_; |
496 bool blend_shadow_; | 495 bool blend_shadow_; |
497 unsigned program_shadow_; | 496 unsigned program_shadow_; |
498 TexturedQuadDrawCache draw_cache_; | 497 TexturedQuadDrawCache draw_cache_; |
499 int highp_threshold_min_; | 498 int highp_threshold_min_; |
500 int highp_threshold_cache_; | 499 int highp_threshold_cache_; |
(...skipping 25 matching lines...) Expand all Loading... |
526 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 525 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
527 #define GLC(context, x) \ | 526 #define GLC(context, x) \ |
528 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 527 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
529 #else | 528 #else |
530 #define GLC(context, x) (x) | 529 #define GLC(context, x) (x) |
531 #endif | 530 #endif |
532 | 531 |
533 } // namespace cc | 532 } // namespace cc |
534 | 533 |
535 #endif // CC_OUTPUT_GL_RENDERER_H_ | 534 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |