| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 310 |
| 311 if (ViewportSize().IsEmpty()) | 311 if (ViewportSize().IsEmpty()) |
| 312 return; | 312 return; |
| 313 | 313 |
| 314 TRACE_EVENT0("cc", "GLRenderer::DrawLayers"); | 314 TRACE_EVENT0("cc", "GLRenderer::DrawLayers"); |
| 315 if (is_viewport_changed_) { | 315 if (is_viewport_changed_) { |
| 316 // Only reshape when we know we are going to draw. Otherwise, the reshape | 316 // Only reshape when we know we are going to draw. Otherwise, the reshape |
| 317 // can leave the window at the wrong size if we never draw and the proper | 317 // can leave the window at the wrong size if we never draw and the proper |
| 318 // viewport size is never set. | 318 // viewport size is never set. |
| 319 is_viewport_changed_ = false; | 319 is_viewport_changed_ = false; |
| 320 output_surface_->Reshape(gfx::Size(ViewportWidth(), ViewportHeight())); | 320 output_surface_->Reshape(gfx::Size(ViewportWidth(), ViewportHeight()), |
| 321 DeviceScaleFactor()); |
| 321 } | 322 } |
| 322 | 323 |
| 323 MakeContextCurrent(); | 324 MakeContextCurrent(); |
| 324 | 325 |
| 325 ReinitializeGLState(); | 326 ReinitializeGLState(); |
| 326 } | 327 } |
| 327 | 328 |
| 328 void GLRenderer::DoNoOp() { | 329 void GLRenderer::DoNoOp() { |
| 329 GLC(context_, context_->bindFramebuffer(GL_FRAMEBUFFER, 0)); | 330 GLC(context_, context_->bindFramebuffer(GL_FRAMEBUFFER, 0)); |
| 330 GLC(context_, context_->flush()); | 331 GLC(context_, context_->flush()); |
| (...skipping 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2908 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas | 2909 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas |
| 2909 // implementation. | 2910 // implementation. |
| 2910 return gr_context_ && context_->getContextAttributes().stencil; | 2911 return gr_context_ && context_->getContextAttributes().stencil; |
| 2911 } | 2912 } |
| 2912 | 2913 |
| 2913 bool GLRenderer::IsContextLost() { | 2914 bool GLRenderer::IsContextLost() { |
| 2914 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2915 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 2915 } | 2916 } |
| 2916 | 2917 |
| 2917 } // namespace cc | 2918 } // namespace cc |
| OLD | NEW |