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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 virtual void BeginDrawingFrame(DrawingFrame* frame) OVERRIDE; | 117 virtual void BeginDrawingFrame(DrawingFrame* frame) OVERRIDE; |
118 virtual void FinishDrawingFrame(DrawingFrame* frame) OVERRIDE; | 118 virtual void FinishDrawingFrame(DrawingFrame* frame) OVERRIDE; |
119 virtual bool FlippedFramebuffer() const OVERRIDE; | 119 virtual bool FlippedFramebuffer() const OVERRIDE; |
120 virtual void EnsureScissorTestEnabled() OVERRIDE; | 120 virtual void EnsureScissorTestEnabled() OVERRIDE; |
121 virtual void EnsureScissorTestDisabled() OVERRIDE; | 121 virtual void EnsureScissorTestDisabled() OVERRIDE; |
122 virtual void CopyCurrentRenderPassToBitmap( | 122 virtual void CopyCurrentRenderPassToBitmap( |
123 DrawingFrame* frame, | 123 DrawingFrame* frame, |
124 scoped_ptr<CopyOutputRequest> request) OVERRIDE; | 124 scoped_ptr<CopyOutputRequest> request) OVERRIDE; |
125 virtual void FinishDrawingQuadList() OVERRIDE; | 125 virtual void FinishDrawingQuadList() OVERRIDE; |
126 | 126 |
| 127 // Check if quad needs antialiasing and if so, inflate the quad and |
| 128 // fill edge array for fragment shader. local_quad is set to |
| 129 // inflated quad if antialiasing is required, otherwise it is left |
| 130 // unchanged. edge array is filled with inflated quad's edge data |
| 131 // if antialiasing is required, otherwise it is left unchanged. |
| 132 // Returns true if quad requires antialiasing and false otherwise. |
| 133 static bool SetupQuadForAntialiasing(const gfx::Transform& device_transform, |
| 134 const DrawQuad* quad, |
| 135 gfx::QuadF* local_quad, |
| 136 float edge[24]); |
| 137 |
127 private: | 138 private: |
128 friend class GLRendererShaderPixelTest; | 139 friend class GLRendererShaderPixelTest; |
129 friend class GLRendererShaderTest; | 140 friend class GLRendererShaderTest; |
130 | 141 |
131 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform); | 142 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform); |
132 | 143 |
133 void DrawCheckerboardQuad(const DrawingFrame* frame, | 144 void DrawCheckerboardQuad(const DrawingFrame* frame, |
134 const CheckerboardDrawQuad* quad); | 145 const CheckerboardDrawQuad* quad); |
135 void DrawDebugBorderQuad(const DrawingFrame* frame, | 146 void DrawDebugBorderQuad(const DrawingFrame* frame, |
136 const DebugBorderDrawQuad* quad); | 147 const DebugBorderDrawQuad* quad); |
(...skipping 30 matching lines...) Expand all Loading... |
167 const gfx::RectF& quad_rect, | 178 const gfx::RectF& quad_rect, |
168 int matrix_location); | 179 int matrix_location); |
169 void SetUseProgram(unsigned program); | 180 void SetUseProgram(unsigned program); |
170 | 181 |
171 void CopyTextureToFramebuffer(const DrawingFrame* frame, | 182 void CopyTextureToFramebuffer(const DrawingFrame* frame, |
172 int texture_id, | 183 int texture_id, |
173 gfx::Rect rect, | 184 gfx::Rect rect, |
174 const gfx::Transform& draw_matrix, | 185 const gfx::Transform& draw_matrix, |
175 bool flip_vertically); | 186 bool flip_vertically); |
176 | 187 |
177 // Check if quad needs antialiasing and if so, inflate the quad and | |
178 // fill edge array for fragment shader. local_quad is set to | |
179 // inflated quad if antialiasing is required, otherwise it is left | |
180 // unchanged. edge array is filled with inflated quad's edge data | |
181 // if antialiasing is required, otherwise it is left unchanged. | |
182 // Returns true if quad requires antialiasing and false otherwise. | |
183 bool SetupQuadForAntialiasing(const gfx::Transform& device_transform, | |
184 const DrawQuad* quad, | |
185 gfx::QuadF* local_quad, | |
186 float edge[24]) const; | |
187 | |
188 bool UseScopedTexture(DrawingFrame* frame, | 188 bool UseScopedTexture(DrawingFrame* frame, |
189 const ScopedResource* resource, | 189 const ScopedResource* resource, |
190 gfx::Rect viewport_rect); | 190 gfx::Rect viewport_rect); |
191 | 191 |
192 bool MakeContextCurrent(); | 192 bool MakeContextCurrent(); |
193 | 193 |
194 bool InitializeSharedObjects(); | 194 bool InitializeSharedObjects(); |
195 void CleanupSharedObjects(); | 195 void CleanupSharedObjects(); |
196 | 196 |
197 typedef base::Callback<void(scoped_ptr<CopyOutputRequest> copy_request, | 197 typedef base::Callback<void(scoped_ptr<CopyOutputRequest> copy_request, |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 460 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
461 #define GLC(context, x) \ | 461 #define GLC(context, x) \ |
462 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 462 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
463 #else | 463 #else |
464 #define GLC(context, x) (x) | 464 #define GLC(context, x) (x) |
465 #endif | 465 #endif |
466 | 466 |
467 } // namespace cc | 467 } // namespace cc |
468 | 468 |
469 #endif // CC_OUTPUT_GL_RENDERER_H_ | 469 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |