Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: ui/gl/glx_api_unittest.cc

Issue 2588263005: Change GLGetProcAddress typedef to function returning function pointer (Closed)
Patch Set: fix cast Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 5 #include <memory>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gl/gl_glx_api_implementation.h" 9 #include "ui/gl/gl_glx_api_implementation.h"
10 #include "ui/gl/gl_implementation.h" 10 #include "ui/gl/gl_implementation.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 static GLXContext FakeCreateContextAttribsARB(Display* dpy, 52 static GLXContext FakeCreateContextAttribsARB(Display* dpy,
53 GLXFBConfig config, 53 GLXFBConfig config,
54 GLXContext share_context, 54 GLXContext share_context,
55 int direct, 55 int direct,
56 const int* attrib_list) { 56 const int* attrib_list) {
57 return static_cast<GLXContext>(nullptr); 57 return static_cast<GLXContext>(nullptr);
58 } 58 }
59 59
60 static void* GL_BINDING_CALL FakeGLGetProcAddress(const char *proc) { 60 static GLFunctionPointerType GL_BINDING_CALL
61 FakeGLGetProcAddress(const char* proc) {
61 if (!strcmp("glXCreateContextAttribsARB", proc)) { 62 if (!strcmp("glXCreateContextAttribsARB", proc)) {
62 return reinterpret_cast<void *>(&FakeCreateContextAttribsARB); 63 return reinterpret_cast<GLFunctionPointerType>(
64 &FakeCreateContextAttribsARB);
63 } 65 }
64 return NULL; 66 return NULL;
65 } 67 }
66 68
67 static const char* GL_BINDING_CALL FakeQueryExtensionsString(Display* dpy, 69 static const char* GL_BINDING_CALL FakeQueryExtensionsString(Display* dpy,
68 int screen) { 70 int screen) {
69 return fake_extension_string_; 71 return fake_extension_string_;
70 } 72 }
71 73
72 protected: 74 protected:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 110
109 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); 111 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
110 command_line.AppendSwitchASCII(switches::kDisableGLExtensions, 112 command_line.AppendSwitchASCII(switches::kDisableGLExtensions,
111 kFakeDisabledExtensions); 113 kFakeDisabledExtensions);
112 InitializeAPI(&command_line); 114 InitializeAPI(&command_line);
113 115
114 EXPECT_STREQ(kFilteredExtensions, GetExtensions()); 116 EXPECT_STREQ(kFilteredExtensions, GetExtensions());
115 } 117 }
116 118
117 } // namespace gl 119 } // namespace gl
OLDNEW
« ui/gl/gl_implementation.h ('K') | « ui/gl/gl_mock.h ('k') | ui/gl/wgl_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698