| 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/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 context_->pushGroupMarkerEXT("CompositorContext"); | 149 context_->pushGroupMarkerEXT("CompositorContext"); |
| 150 | 150 |
| 151 std::string extensions_string = | 151 std::string extensions_string = |
| 152 UTF16ToASCII(context_->getString(GL_EXTENSIONS)); | 152 UTF16ToASCII(context_->getString(GL_EXTENSIONS)); |
| 153 std::vector<std::string> extensions_list; | 153 std::vector<std::string> extensions_list; |
| 154 base::SplitString(extensions_string, ' ', &extensions_list); | 154 base::SplitString(extensions_string, ' ', &extensions_list); |
| 155 std::set<std::string> extensions(extensions_list.begin(), | 155 std::set<std::string> extensions(extensions_list.begin(), |
| 156 extensions_list.end()); | 156 extensions_list.end()); |
| 157 | 157 |
| 158 if (Settings().accelerate_painting && | |
| 159 extensions.count("GL_EXT_texture_format_BGRA8888") && | |
| 160 extensions.count("GL_EXT_read_format_bgra")) | |
| 161 capabilities_.using_accelerated_painting = true; | |
| 162 else | |
| 163 capabilities_.using_accelerated_painting = false; | |
| 164 | |
| 165 capabilities_.using_partial_swap = | 158 capabilities_.using_partial_swap = |
| 166 Settings().partial_swap_enabled && | 159 Settings().partial_swap_enabled && |
| 167 extensions.count("GL_CHROMIUM_post_sub_buffer"); | 160 extensions.count("GL_CHROMIUM_post_sub_buffer"); |
| 168 | 161 |
| 169 // Use the SwapBuffers callback only with the threaded proxy. | 162 // Use the SwapBuffers callback only with the threaded proxy. |
| 170 if (client_->HasImplThread()) | 163 if (client_->HasImplThread()) |
| 171 capabilities_.using_swap_complete_callback = | 164 capabilities_.using_swap_complete_callback = |
| 172 extensions.count("GL_CHROMIUM_swapbuffers_complete_callback") > 0; | 165 extensions.count("GL_CHROMIUM_swapbuffers_complete_callback") > 0; |
| 173 | 166 |
| 174 capabilities_.using_set_visibility = | 167 capabilities_.using_set_visibility = |
| (...skipping 2736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2911 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas | 2904 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas |
| 2912 // implementation. | 2905 // implementation. |
| 2913 return gr_context_ && context_->getContextAttributes().stencil; | 2906 return gr_context_ && context_->getContextAttributes().stencil; |
| 2914 } | 2907 } |
| 2915 | 2908 |
| 2916 bool GLRenderer::IsContextLost() { | 2909 bool GLRenderer::IsContextLost() { |
| 2917 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2910 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 2918 } | 2911 } |
| 2919 | 2912 |
| 2920 } // namespace cc | 2913 } // namespace cc |
| OLD | NEW |