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/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2229 // variable in fragment shaders. | 2229 // variable in fragment shaders. |
2230 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { | 2230 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { |
2231 glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); | 2231 glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); |
2232 glEnable(GL_POINT_SPRITE); | 2232 glEnable(GL_POINT_SPRITE); |
2233 } | 2233 } |
2234 | 2234 |
2235 has_arb_robustness_ = context->HasExtension("GL_ARB_robustness"); | 2235 has_arb_robustness_ = context->HasExtension("GL_ARB_robustness"); |
2236 | 2236 |
2237 if (!disable_workarounds_) { | 2237 if (!disable_workarounds_) { |
2238 #if defined(OS_MACOSX) | 2238 #if defined(OS_MACOSX) |
2239 const char* vendor_str = reinterpret_cast<const char*>( | |
2240 glGetString(GL_VENDOR)); | |
2241 needs_mac_nvidia_driver_workaround_ = | 2239 needs_mac_nvidia_driver_workaround_ = |
2242 vendor_str && strstr(vendor_str, "NVIDIA"); | 2240 feature_info_->feature_flags().is_nvidia; |
2243 needs_glsl_built_in_function_emulation_ = | 2241 needs_glsl_built_in_function_emulation_ = |
2244 vendor_str && (strstr(vendor_str, "ATI") || strstr(vendor_str, "AMD")); | 2242 feature_info_->feature_flags().is_amd; |
2245 #endif | 2243 #endif |
2246 } | 2244 } |
2247 | 2245 |
2248 if (!InitializeShaderTranslator()) { | 2246 if (!InitializeShaderTranslator()) { |
2249 return false; | 2247 return false; |
2250 } | 2248 } |
2251 | 2249 |
2252 viewport_width_ = size.width(); | 2250 viewport_width_ = size.width(); |
2253 viewport_height_ = size.height(); | 2251 viewport_height_ = size.height(); |
2254 glViewport(viewport_x_, viewport_y_, viewport_width_, viewport_height_); | 2252 glViewport(viewport_x_, viewport_y_, viewport_width_, viewport_height_); |
(...skipping 6473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8728 BindAndApplyTextureParameters(info); | 8726 BindAndApplyTextureParameters(info); |
8729 } | 8727 } |
8730 | 8728 |
8731 // Include the auto-generated part of this file. We split this because it means | 8729 // Include the auto-generated part of this file. We split this because it means |
8732 // we can easily edit the non-auto generated parts right here in this file | 8730 // we can easily edit the non-auto generated parts right here in this file |
8733 // instead of having to edit some template or the code generator. | 8731 // instead of having to edit some template or the code generator. |
8734 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 8732 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
8735 | 8733 |
8736 } // namespace gles2 | 8734 } // namespace gles2 |
8737 } // namespace gpu | 8735 } // namespace gpu |
OLD | NEW |