| 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/gl_renderer.h" | 5 #include "cc/gl_renderer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 return ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING; | 1395 return ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING; |
| 1396 } | 1396 } |
| 1397 | 1397 |
| 1398 void GLRenderer::enforceMemoryPolicy() | 1398 void GLRenderer::enforceMemoryPolicy() |
| 1399 { | 1399 { |
| 1400 if (!m_visible) { | 1400 if (!m_visible) { |
| 1401 TRACE_EVENT0("cc", "GLRenderer::enforceMemoryPolicy dropping resources")
; | 1401 TRACE_EVENT0("cc", "GLRenderer::enforceMemoryPolicy dropping resources")
; |
| 1402 releaseRenderPassTextures(); | 1402 releaseRenderPassTextures(); |
| 1403 if (m_discardBackbufferWhenNotVisible) | 1403 if (m_discardBackbufferWhenNotVisible) |
| 1404 discardBackbuffer(); | 1404 discardBackbuffer(); |
| 1405 m_resourceProvider->releaseCachedData(); |
| 1405 GLC(m_context, m_context->flush()); | 1406 GLC(m_context, m_context->flush()); |
| 1406 } | 1407 } |
| 1407 } | 1408 } |
| 1408 | 1409 |
| 1409 void GLRenderer::discardBackbuffer() | 1410 void GLRenderer::discardBackbuffer() |
| 1410 { | 1411 { |
| 1411 if (m_isBackbufferDiscarded) | 1412 if (m_isBackbufferDiscarded) |
| 1412 return; | 1413 return; |
| 1413 | 1414 |
| 1414 if (!m_capabilities.usingDiscardBackbuffer) | 1415 if (!m_capabilities.usingDiscardBackbuffer) |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1831 | 1832 |
| 1832 releaseRenderPassTextures(); | 1833 releaseRenderPassTextures(); |
| 1833 } | 1834 } |
| 1834 | 1835 |
| 1835 bool GLRenderer::isContextLost() | 1836 bool GLRenderer::isContextLost() |
| 1836 { | 1837 { |
| 1837 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1838 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 1838 } | 1839 } |
| 1839 | 1840 |
| 1840 } // namespace cc | 1841 } // namespace cc |
| OLD | NEW |