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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if (m_client->hasImplThread()) | 129 if (m_client->hasImplThread()) |
130 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM
_swapbuffers_complete_callback"); | 130 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM
_swapbuffers_complete_callback"); |
131 if (m_capabilities.usingSwapCompleteCallback) | 131 if (m_capabilities.usingSwapCompleteCallback) |
132 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this); | 132 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this); |
133 | 133 |
134 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi
lity"); | 134 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi
lity"); |
135 | 135 |
136 if (extensions.count("GL_CHROMIUM_iosurface")) | 136 if (extensions.count("GL_CHROMIUM_iosurface")) |
137 DCHECK(extensions.count("GL_ARB_texture_rectangle")); | 137 DCHECK(extensions.count("GL_ARB_texture_rectangle")); |
138 | 138 |
139 m_capabilities.usingGpuMemoryManager = extensions.count("GL_CHROMIUM_gpu_mem
ory_manager"); | 139 m_capabilities.usingGpuMemoryManager = extensions.count("GL_CHROMIUM_gpu_mem
ory_manager") |
| 140 && settings().useMemoryManagement; |
140 if (m_capabilities.usingGpuMemoryManager) | 141 if (m_capabilities.usingGpuMemoryManager) |
141 m_context->setMemoryAllocationChangedCallbackCHROMIUM(this); | 142 m_context->setMemoryAllocationChangedCallbackCHROMIUM(this); |
142 | 143 |
143 m_capabilities.usingDiscardBackbuffer = extensions.count("GL_CHROMIUM_discar
d_backbuffer"); | 144 m_capabilities.usingDiscardBackbuffer = extensions.count("GL_CHROMIUM_discar
d_backbuffer"); |
144 | 145 |
145 m_capabilities.usingEglImage = extensions.count("GL_OES_EGL_image_external")
; | 146 m_capabilities.usingEglImage = extensions.count("GL_OES_EGL_image_external")
; |
146 | 147 |
147 m_capabilities.maxTextureSize = m_resourceProvider->maxTextureSize(); | 148 m_capabilities.maxTextureSize = m_resourceProvider->maxTextureSize(); |
148 m_capabilities.bestTextureFormat = m_resourceProvider->bestTextureFormat(); | 149 m_capabilities.bestTextureFormat = m_resourceProvider->bestTextureFormat(); |
149 | 150 |
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1813 | 1814 |
1814 releaseRenderPassTextures(); | 1815 releaseRenderPassTextures(); |
1815 } | 1816 } |
1816 | 1817 |
1817 bool GLRenderer::isContextLost() | 1818 bool GLRenderer::isContextLost() |
1818 { | 1819 { |
1819 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1820 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
1820 } | 1821 } |
1821 | 1822 |
1822 } // namespace cc | 1823 } // namespace cc |
OLD | NEW |