| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 num_fake_extension_strings_ = 0; | 44 num_fake_extension_strings_ = 0; |
| 45 fake_extension_strings_ = nullptr; | 45 fake_extension_strings_ = nullptr; |
| 46 | 46 |
| 47 DCHECK(!g_current_gl_context_tls); | 47 DCHECK(!g_current_gl_context_tls); |
| 48 g_current_gl_context_tls = new base::ThreadLocalPointer<GLApi>; | 48 g_current_gl_context_tls = new base::ThreadLocalPointer<GLApi>; |
| 49 | 49 |
| 50 SetGLGetProcAddressProc( | 50 SetGLGetProcAddressProc( |
| 51 static_cast<GLGetProcAddressProc>(&FakeGLGetProcAddress)); | 51 static_cast<GLGetProcAddressProc>(&FakeGLGetProcAddress)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 static void* GL_BINDING_CALL FakeGLGetProcAddress(const char *proc) { | 54 static GLFunctionPointerType GL_BINDING_CALL |
| 55 return reinterpret_cast<void*>(0x1); | 55 FakeGLGetProcAddress(const char* proc) { |
| 56 return reinterpret_cast<GLFunctionPointerType>(0x1); |
| 56 } | 57 } |
| 57 | 58 |
| 58 void TearDown() override { | 59 void TearDown() override { |
| 59 api_.reset(nullptr); | 60 api_.reset(nullptr); |
| 60 delete g_current_gl_context_tls; | 61 delete g_current_gl_context_tls; |
| 61 g_current_gl_context_tls = nullptr; | 62 g_current_gl_context_tls = nullptr; |
| 62 | 63 |
| 63 SetGLImplementation(kGLImplementationNone); | 64 SetGLImplementation(kGLImplementationNone); |
| 64 fake_extension_string_ = ""; | 65 fake_extension_string_ = ""; |
| 65 fake_version_string_ = ""; | 66 fake_version_string_ = ""; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 kFakeDisabledExtensions); | 212 kFakeDisabledExtensions); |
| 212 InitializeAPI(&command_line); | 213 InitializeAPI(&command_line); |
| 213 | 214 |
| 214 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); | 215 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); |
| 215 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { | 216 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { |
| 216 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); | 217 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); |
| 217 } | 218 } |
| 218 } | 219 } |
| 219 | 220 |
| 220 } // namespace gl | 221 } // namespace gl |
| OLD | NEW |