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 #include "cc/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 GLRenderer::GLRenderer(RendererClient* client, | 160 GLRenderer::GLRenderer(RendererClient* client, |
161 const LayerTreeSettings* settings, | 161 const LayerTreeSettings* settings, |
162 OutputSurface* output_surface, | 162 OutputSurface* output_surface, |
163 ResourceProvider* resource_provider, | 163 ResourceProvider* resource_provider, |
164 TextureMailboxDeleter* texture_mailbox_deleter, | 164 TextureMailboxDeleter* texture_mailbox_deleter, |
165 int highp_threshold_min) | 165 int highp_threshold_min) |
166 : DirectRenderer(client, settings, output_surface, resource_provider), | 166 : DirectRenderer(client, settings, output_surface, resource_provider), |
167 offscreen_framebuffer_id_(0), | 167 offscreen_framebuffer_id_(0), |
168 shared_geometry_quad_(gfx::RectF(-0.5f, -0.5f, 1.0f, 1.0f)), | 168 shared_geometry_quad_(gfx::RectF(-0.5f, -0.5f, 1.0f, 1.0f)), |
169 context_(output_surface->context_provider()->Context3d()), | |
170 gl_(output_surface->context_provider()->ContextGL()), | 169 gl_(output_surface->context_provider()->ContextGL()), |
171 context_support_(output_surface->context_provider()->ContextSupport()), | 170 context_support_(output_surface->context_provider()->ContextSupport()), |
172 texture_mailbox_deleter_(texture_mailbox_deleter), | 171 texture_mailbox_deleter_(texture_mailbox_deleter), |
173 is_backbuffer_discarded_(false), | 172 is_backbuffer_discarded_(false), |
174 visible_(true), | 173 visible_(true), |
175 is_scissor_enabled_(false), | 174 is_scissor_enabled_(false), |
176 scissor_rect_needs_reset_(true), | 175 scissor_rect_needs_reset_(true), |
177 stencil_shadow_(false), | 176 stencil_shadow_(false), |
178 blend_shadow_(false), | 177 blend_shadow_(false), |
179 highp_threshold_min_(highp_threshold_min), | 178 highp_threshold_min_(highp_threshold_min), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 pending_async_read_pixels_.pop_back(); | 218 pending_async_read_pixels_.pop_back(); |
220 } | 219 } |
221 | 220 |
222 CleanupSharedObjects(); | 221 CleanupSharedObjects(); |
223 } | 222 } |
224 | 223 |
225 const RendererCapabilities& GLRenderer::Capabilities() const { | 224 const RendererCapabilities& GLRenderer::Capabilities() const { |
226 return capabilities_; | 225 return capabilities_; |
227 } | 226 } |
228 | 227 |
229 WebGraphicsContext3D* GLRenderer::Context() { return context_; } | |
230 | |
231 void GLRenderer::DebugGLCall(GLES2Interface* gl, | 228 void GLRenderer::DebugGLCall(GLES2Interface* gl, |
232 const char* command, | 229 const char* command, |
233 const char* file, | 230 const char* file, |
234 int line) { | 231 int line) { |
235 GLuint error = gl->GetError(); | 232 GLuint error = gl->GetError(); |
236 if (error != GL_NO_ERROR) | 233 if (error != GL_NO_ERROR) |
237 LOG(ERROR) << "GL command failed: File: " << file << "\n\tLine " << line | 234 LOG(ERROR) << "GL command failed: File: " << file << "\n\tLine " << line |
238 << "\n\tcommand: " << command << ", error " | 235 << "\n\tcommand: " << command << ", error " |
239 << static_cast<int>(error) << "\n"; | 236 << static_cast<int>(error) << "\n"; |
240 } | 237 } |
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3008 is_scissor_enabled_ = false; | 3005 is_scissor_enabled_ = false; |
3009 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); | 3006 GLC(gl_, gl_->Disable(GL_SCISSOR_TEST)); |
3010 scissor_rect_needs_reset_ = true; | 3007 scissor_rect_needs_reset_ = true; |
3011 } | 3008 } |
3012 | 3009 |
3013 bool GLRenderer::IsContextLost() { | 3010 bool GLRenderer::IsContextLost() { |
3014 return output_surface_->context_provider()->IsContextLost(); | 3011 return output_surface_->context_provider()->IsContextLost(); |
3015 } | 3012 } |
3016 | 3013 |
3017 } // namespace cc | 3014 } // namespace cc |
OLD | NEW |