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 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 | 1343 |
1347 if (!m_capabilities.usingDiscardFramebuffer) | 1344 if (!m_capabilities.usingDiscardFramebuffer) |
1348 return; | 1345 return; |
1349 | 1346 |
1350 m_context->ensureFramebufferCHROMIUM(); | 1347 m_context->ensureFramebufferCHROMIUM(); |
1351 m_isFramebufferDiscarded = false; | 1348 m_isFramebufferDiscarded = false; |
1352 } | 1349 } |
1353 | 1350 |
1354 void GLRenderer::onContextLost() | 1351 void GLRenderer::onContextLost() |
1355 { | 1352 { |
1356 m_client->didLoseContext(); | 1353 m_client->didLoseOutputSurface(); |
1357 } | 1354 } |
1358 | 1355 |
1359 | 1356 |
1360 void GLRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect) | 1357 void GLRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect) |
1361 { | 1358 { |
1362 DCHECK(rect.right() <= viewportWidth()); | 1359 DCHECK(rect.right() <= viewportWidth()); |
1363 DCHECK(rect.bottom() <= viewportHeight()); | 1360 DCHECK(rect.bottom() <= viewportHeight()); |
1364 | 1361 |
1365 if (!pixels) | 1362 if (!pixels) |
1366 return; | 1363 return; |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 | 1748 |
1752 releaseRenderPassTextures(); | 1749 releaseRenderPassTextures(); |
1753 } | 1750 } |
1754 | 1751 |
1755 bool GLRenderer::isContextLost() | 1752 bool GLRenderer::isContextLost() |
1756 { | 1753 { |
1757 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1754 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
1758 } | 1755 } |
1759 | 1756 |
1760 } // namespace cc | 1757 } // namespace cc |
OLD | NEW |