| 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 "ui/gl/gl_gl_api_implementation.h" | 5 #include "ui/gl/gl_gl_api_implementation.h" |
| 6 | 6 |
| 7 #include <algorithm> | |
| 8 #include <vector> | 7 #include <vector> |
| 9 | 8 |
| 10 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/stl_util.h" |
| 11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "ui/gl/gl_context.h" | 13 #include "ui/gl/gl_context.h" |
| 14 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 15 #include "ui/gl/gl_state_restorer.h" | 15 #include "ui/gl/gl_state_restorer.h" |
| 16 #include "ui/gl/gl_surface.h" | 16 #include "ui/gl/gl_surface.h" |
| 17 #include "ui/gl/gl_switches.h" | 17 #include "ui/gl/gl_switches.h" |
| 18 #include "ui/gl/gl_version_info.h" | 18 #include "ui/gl/gl_version_info.h" |
| 19 | 19 |
| 20 namespace gfx { | 20 namespace gfx { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 disabled_exts_); | 484 disabled_exts_); |
| 485 filtered_exts_ = base::SplitString( | 485 filtered_exts_ = base::SplitString( |
| 486 filtered_exts_str_, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 486 filtered_exts_str_, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 487 } else { | 487 } else { |
| 488 GLint num_extensions = 0; | 488 GLint num_extensions = 0; |
| 489 GLApiBase::glGetIntegervFn(GL_NUM_EXTENSIONS, &num_extensions); | 489 GLApiBase::glGetIntegervFn(GL_NUM_EXTENSIONS, &num_extensions); |
| 490 for (GLint i = 0; i < num_extensions; ++i) { | 490 for (GLint i = 0; i < num_extensions; ++i) { |
| 491 const char* gl_extension = reinterpret_cast<const char*>( | 491 const char* gl_extension = reinterpret_cast<const char*>( |
| 492 GLApiBase::glGetStringiFn(GL_EXTENSIONS, i)); | 492 GLApiBase::glGetStringiFn(GL_EXTENSIONS, i)); |
| 493 DCHECK(gl_extension != NULL); | 493 DCHECK(gl_extension != NULL); |
| 494 if (std::find(disabled_exts_.begin(), disabled_exts_.end(), | 494 if (!ContainsValue(disabled_exts_, gl_extension)) |
| 495 gl_extension) == disabled_exts_.end()) { | |
| 496 filtered_exts_.push_back(gl_extension); | 495 filtered_exts_.push_back(gl_extension); |
| 497 } | |
| 498 } | 496 } |
| 499 filtered_exts_str_ = base::JoinString(filtered_exts_, " "); | 497 filtered_exts_str_ = base::JoinString(filtered_exts_, " "); |
| 500 } | 498 } |
| 501 #if DCHECK_IS_ON() | 499 #if DCHECK_IS_ON() |
| 502 filtered_exts_initialized_ = true; | 500 filtered_exts_initialized_ = true; |
| 503 #endif | 501 #endif |
| 504 } | 502 } |
| 505 } | 503 } |
| 506 | 504 |
| 507 TraceGLApi::~TraceGLApi() { | 505 TraceGLApi::~TraceGLApi() { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 | 609 |
| 612 void VirtualGLApi::glFlushFn() { | 610 void VirtualGLApi::glFlushFn() { |
| 613 GLApiBase::glFlushFn(); | 611 GLApiBase::glFlushFn(); |
| 614 } | 612 } |
| 615 | 613 |
| 616 void VirtualGLApi::glFinishFn() { | 614 void VirtualGLApi::glFinishFn() { |
| 617 GLApiBase::glFinishFn(); | 615 GLApiBase::glFinishFn(); |
| 618 } | 616 } |
| 619 | 617 |
| 620 } // namespace gfx | 618 } // namespace gfx |
| OLD | NEW |