| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/gl/gl_egl_api_implementation.h" | 8 #include "ui/gl/gl_egl_api_implementation.h" |
| 9 #include "ui/gl/gl_switches.h" | 9 #include "ui/gl/gl_switches.h" |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 fake_extension_string_ = ""; | 32 fake_extension_string_ = ""; |
| 33 } | 33 } |
| 34 | 34 |
| 35 void InitializeAPI(base::CommandLine* command_line) { | 35 void InitializeAPI(base::CommandLine* command_line) { |
| 36 api_.reset(new RealEGLApi()); | 36 api_.reset(new RealEGLApi()); |
| 37 g_current_egl_context = api_.get(); | 37 g_current_egl_context = api_.get(); |
| 38 if (command_line) | 38 if (command_line) |
| 39 api_->InitializeWithCommandLine(&g_driver_egl, command_line); | 39 api_->InitializeWithCommandLine(&g_driver_egl, command_line); |
| 40 else | 40 else |
| 41 api_->Initialize(&g_driver_egl); | 41 api_->Initialize(&g_driver_egl); |
| 42 api_->InitializeFilteredExtensions(); | |
| 43 } | 42 } |
| 44 | 43 |
| 45 void SetFakeExtensionString(const char* fake_string) { | 44 void SetFakeExtensionString(const char* fake_string) { |
| 46 fake_extension_string_ = fake_string; | 45 fake_extension_string_ = fake_string; |
| 47 } | 46 } |
| 48 | 47 |
| 49 static EGLBoolean GL_BINDING_CALL FakeInitialize(EGLDisplay display, | 48 static EGLBoolean GL_BINDING_CALL FakeInitialize(EGLDisplay display, |
| 50 EGLint * major, | 49 EGLint * major, |
| 51 EGLint * minor) { | 50 EGLint * minor) { |
| 52 return EGL_TRUE; | 51 return EGL_TRUE; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 95 |
| 97 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 96 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
| 98 command_line.AppendSwitchASCII(switches::kDisableGLExtensions, | 97 command_line.AppendSwitchASCII(switches::kDisableGLExtensions, |
| 99 kFakeDisabledExtensions); | 98 kFakeDisabledExtensions); |
| 100 InitializeAPI(&command_line); | 99 InitializeAPI(&command_line); |
| 101 | 100 |
| 102 EXPECT_STREQ(kFilteredExtensions, GetExtensions()); | 101 EXPECT_STREQ(kFilteredExtensions, GetExtensions()); |
| 103 } | 102 } |
| 104 | 103 |
| 105 } // namespace gfx | 104 } // namespace gfx |
| OLD | NEW |