OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/context_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 &max_cube_map_texture_size)) { | 156 &max_cube_map_texture_size)) { |
157 LOG(ERROR) << "ContextGroup::Initialize failed because maximum texture size" | 157 LOG(ERROR) << "ContextGroup::Initialize failed because maximum texture size" |
158 << "is too small."; | 158 << "is too small."; |
159 return false; | 159 return false; |
160 } | 160 } |
161 | 161 |
162 // Limit Intel on Mac to 512. | 162 // Limit Intel on Mac to 512. |
163 // TODO(gman): Update this code to check for a specific version of | 163 // TODO(gman): Update this code to check for a specific version of |
164 // the drivers above which we no longer need this fix. | 164 // the drivers above which we no longer need this fix. |
165 #if defined(OS_MACOSX) | 165 #if defined(OS_MACOSX) |
166 const char* vendor_str = reinterpret_cast<const char*>( | 166 if (feature_info_->feature_flags().is_intel) { |
167 glGetString(GL_VENDOR)); | 167 max_texture_size = std::min( |
168 if (vendor_str) { | |
169 std::string lc_str(::StringToLowerASCII(std::string(vendor_str))); | |
170 bool intel_on_mac = strstr(lc_str.c_str(), "intel"); | |
171 if (intel_on_mac) { | |
172 max_texture_size = std::min( | |
173 static_cast<GLint>(4096), max_texture_size); | 168 static_cast<GLint>(4096), max_texture_size); |
174 max_cube_map_texture_size = std::min( | 169 max_cube_map_texture_size = std::min( |
175 static_cast<GLint>(512), max_cube_map_texture_size); | 170 static_cast<GLint>(512), max_cube_map_texture_size); |
176 } | |
177 } | 171 } |
178 #endif | 172 #endif |
179 texture_manager_.reset(new TextureManager(feature_info_.get(), | 173 texture_manager_.reset(new TextureManager(feature_info_.get(), |
180 max_texture_size, | 174 max_texture_size, |
181 max_cube_map_texture_size)); | 175 max_cube_map_texture_size)); |
182 | 176 |
183 const GLint kMinTextureImageUnits = 8; | 177 const GLint kMinTextureImageUnits = 8; |
184 const GLint kMinVertexTextureImageUnits = 0; | 178 const GLint kMinVertexTextureImageUnits = 0; |
185 if (!QueryGLFeatureU( | 179 if (!QueryGLFeatureU( |
186 GL_MAX_TEXTURE_IMAGE_UNITS, kMinTextureImageUnits, | 180 GL_MAX_TEXTURE_IMAGE_UNITS, kMinTextureImageUnits, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (namespace_id >= arraysize(id_namespaces_)) | 267 if (namespace_id >= arraysize(id_namespaces_)) |
274 return NULL; | 268 return NULL; |
275 | 269 |
276 return id_namespaces_[namespace_id].get(); | 270 return id_namespaces_[namespace_id].get(); |
277 } | 271 } |
278 | 272 |
279 } // namespace gles2 | 273 } // namespace gles2 |
280 } // namespace gpu | 274 } // namespace gpu |
281 | 275 |
282 | 276 |
OLD | NEW |