| 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 "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 std::vector<std::string> extensionsList; | 95 std::vector<std::string> extensionsList; |
| 96 base::SplitString(extensionsString, ' ', &extensionsList); | 96 base::SplitString(extensionsString, ' ', &extensionsList); |
| 97 std::set<string> extensions(extensionsList.begin(), extensionsList.end()); | 97 std::set<string> extensions(extensionsList.begin(), extensionsList.end()); |
| 98 | 98 |
| 99 if (settings().acceleratePainting && extensions.count("GL_EXT_texture_format
_BGRA8888") | 99 if (settings().acceleratePainting && extensions.count("GL_EXT_texture_format
_BGRA8888") |
| 100 && extensions.count("GL_EXT_read_format_bg
ra")) | 100 && extensions.count("GL_EXT_read_format_bg
ra")) |
| 101 m_capabilities.usingAcceleratedPainting = true; | 101 m_capabilities.usingAcceleratedPainting = true; |
| 102 else | 102 else |
| 103 m_capabilities.usingAcceleratedPainting = false; | 103 m_capabilities.usingAcceleratedPainting = false; |
| 104 | 104 |
| 105 | |
| 106 m_capabilities.contextHasCachedFrontBuffer = extensions.count("GL_CHROMIUM_f
ront_buffer_cached"); | |
| 107 | |
| 108 m_capabilities.usingPartialSwap = settings().partialSwapEnabled && extension
s.count("GL_CHROMIUM_post_sub_buffer"); | 105 m_capabilities.usingPartialSwap = settings().partialSwapEnabled && extension
s.count("GL_CHROMIUM_post_sub_buffer"); |
| 109 | 106 |
| 110 // Use the swapBuffers callback only with the threaded proxy. | 107 // Use the swapBuffers callback only with the threaded proxy. |
| 111 if (m_client->hasImplThread()) | 108 if (m_client->hasImplThread()) |
| 112 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM
_swapbuffers_complete_callback"); | 109 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM
_swapbuffers_complete_callback"); |
| 113 if (m_capabilities.usingSwapCompleteCallback) | 110 if (m_capabilities.usingSwapCompleteCallback) |
| 114 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this); | 111 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this); |
| 115 | 112 |
| 116 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi
lity"); | 113 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi
lity"); |
| 117 | 114 |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 | 1340 |
| 1344 if (!m_capabilities.usingDiscardFramebuffer) | 1341 if (!m_capabilities.usingDiscardFramebuffer) |
| 1345 return; | 1342 return; |
| 1346 | 1343 |
| 1347 m_context->ensureFramebufferCHROMIUM(); | 1344 m_context->ensureFramebufferCHROMIUM(); |
| 1348 m_isFramebufferDiscarded = false; | 1345 m_isFramebufferDiscarded = false; |
| 1349 } | 1346 } |
| 1350 | 1347 |
| 1351 void GLRenderer::onContextLost() | 1348 void GLRenderer::onContextLost() |
| 1352 { | 1349 { |
| 1353 m_client->didLoseContext(); | 1350 m_client->didLoseOutputSurface(); |
| 1354 } | 1351 } |
| 1355 | 1352 |
| 1356 | 1353 |
| 1357 void GLRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect) | 1354 void GLRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect) |
| 1358 { | 1355 { |
| 1359 DCHECK(rect.right() <= viewportWidth()); | 1356 DCHECK(rect.right() <= viewportWidth()); |
| 1360 DCHECK(rect.bottom() <= viewportHeight()); | 1357 DCHECK(rect.bottom() <= viewportHeight()); |
| 1361 | 1358 |
| 1362 if (!pixels) | 1359 if (!pixels) |
| 1363 return; | 1360 return; |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 | 1745 |
| 1749 releaseRenderPassTextures(); | 1746 releaseRenderPassTextures(); |
| 1750 } | 1747 } |
| 1751 | 1748 |
| 1752 bool GLRenderer::isContextLost() | 1749 bool GLRenderer::isContextLost() |
| 1753 { | 1750 { |
| 1754 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1751 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 1755 } | 1752 } |
| 1756 | 1753 |
| 1757 } // namespace cc | 1754 } // namespace cc |
| OLD | NEW |