| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 highp_threshold_min_(highp_threshold_min), | 139 highp_threshold_min_(highp_threshold_min), |
| 140 highp_threshold_cache_(0), | 140 highp_threshold_cache_(0), |
| 141 on_demand_tile_raster_resource_id_(0) { | 141 on_demand_tile_raster_resource_id_(0) { |
| 142 DCHECK(context_); | 142 DCHECK(context_); |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool GLRenderer::Initialize() { | 145 bool GLRenderer::Initialize() { |
| 146 if (!context_->makeContextCurrent()) | 146 if (!context_->makeContextCurrent()) |
| 147 return false; | 147 return false; |
| 148 | 148 |
| 149 context_->pushGroupMarkerEXT("CompositorContext"); | 149 context_->pushGroupMarkerEXT(Settings().compositor_name.c_str()); |
| 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 && | 158 if (Settings().accelerate_painting && |
| 159 extensions.count("GL_EXT_texture_format_BGRA8888") && | 159 extensions.count("GL_EXT_texture_format_BGRA8888") && |
| (...skipping 2751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2911 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas | 2911 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas |
| 2912 // implementation. | 2912 // implementation. |
| 2913 return gr_context_ && context_->getContextAttributes().stencil; | 2913 return gr_context_ && context_->getContextAttributes().stencil; |
| 2914 } | 2914 } |
| 2915 | 2915 |
| 2916 bool GLRenderer::IsContextLost() { | 2916 bool GLRenderer::IsContextLost() { |
| 2917 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 2917 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 2918 } | 2918 } |
| 2919 | 2919 |
| 2920 } // namespace cc | 2920 } // namespace cc |
| OLD | NEW |