| 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 |
| 105 m_capabilities.usingPartialSwap = settings().partialSwapEnabled && extension
s.count("GL_CHROMIUM_post_sub_buffer"); | 108 m_capabilities.usingPartialSwap = settings().partialSwapEnabled && extension
s.count("GL_CHROMIUM_post_sub_buffer"); |
| 106 | 109 |
| 107 // Use the swapBuffers callback only with the threaded proxy. | 110 // Use the swapBuffers callback only with the threaded proxy. |
| 108 if (m_client->hasImplThread()) | 111 if (m_client->hasImplThread()) |
| 109 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM
_swapbuffers_complete_callback"); | 112 m_capabilities.usingSwapCompleteCallback = extensions.count("GL_CHROMIUM
_swapbuffers_complete_callback"); |
| 110 if (m_capabilities.usingSwapCompleteCallback) | 113 if (m_capabilities.usingSwapCompleteCallback) |
| 111 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this); | 114 m_context->setSwapBuffersCompleteCallbackCHROMIUM(this); |
| 112 | 115 |
| 113 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi
lity"); | 116 m_capabilities.usingSetVisibility = extensions.count("GL_CHROMIUM_set_visibi
lity"); |
| 114 | 117 |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 | 1346 |
| 1344 if (!m_capabilities.usingDiscardFramebuffer) | 1347 if (!m_capabilities.usingDiscardFramebuffer) |
| 1345 return; | 1348 return; |
| 1346 | 1349 |
| 1347 m_context->ensureFramebufferCHROMIUM(); | 1350 m_context->ensureFramebufferCHROMIUM(); |
| 1348 m_isFramebufferDiscarded = false; | 1351 m_isFramebufferDiscarded = false; |
| 1349 } | 1352 } |
| 1350 | 1353 |
| 1351 void GLRenderer::onContextLost() | 1354 void GLRenderer::onContextLost() |
| 1352 { | 1355 { |
| 1353 m_client->didLoseOutputSurface(); | 1356 m_client->didLoseContext(); |
| 1354 } | 1357 } |
| 1355 | 1358 |
| 1356 | 1359 |
| 1357 void GLRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect) | 1360 void GLRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect) |
| 1358 { | 1361 { |
| 1359 DCHECK(rect.right() <= viewportWidth()); | 1362 DCHECK(rect.right() <= viewportWidth()); |
| 1360 DCHECK(rect.bottom() <= viewportHeight()); | 1363 DCHECK(rect.bottom() <= viewportHeight()); |
| 1361 | 1364 |
| 1362 if (!pixels) | 1365 if (!pixels) |
| 1363 return; | 1366 return; |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 | 1751 |
| 1749 releaseRenderPassTextures(); | 1752 releaseRenderPassTextures(); |
| 1750 } | 1753 } |
| 1751 | 1754 |
| 1752 bool GLRenderer::isContextLost() | 1755 bool GLRenderer::isContextLost() |
| 1753 { | 1756 { |
| 1754 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1757 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 1755 } | 1758 } |
| 1756 | 1759 |
| 1757 } // namespace cc | 1760 } // namespace cc |
| OLD | NEW |