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

Side by Side Diff: tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp

Issue 1894893002: Modernize and trim down SkOnce. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: might as well class Created 4 years, 8 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
« src/core/SkTaskGroup.cpp ('K') | « tests/OnceTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkMutex.h" 9 #include "SkMutex.h"
10 #include "SkOnce.h" 10 #include "SkOnce.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 } 121 }
122 122
123 static GrGLFuncPtr command_buffer_get_gl_proc(void* ctx, const char name[]) { 123 static GrGLFuncPtr command_buffer_get_gl_proc(void* ctx, const char name[]) {
124 if (!gfFunctionsLoadedSuccessfully) { 124 if (!gfFunctionsLoadedSuccessfully) {
125 return nullptr; 125 return nullptr;
126 } 126 }
127 return gfGetProcAddress(name); 127 return gfGetProcAddress(name);
128 } 128 }
129 129
130 SK_DECLARE_STATIC_ONCE(loadCommandBufferOnce);
131 static void load_command_buffer_once() { 130 static void load_command_buffer_once() {
132 SkOnce(&loadCommandBufferOnce, load_command_buffer_functions); 131 static SkOnce once;
132 once(load_command_buffer_functions);
133 } 133 }
134 134
135 static const GrGLInterface* create_command_buffer_interface() { 135 static const GrGLInterface* create_command_buffer_interface() {
136 load_command_buffer_once(); 136 load_command_buffer_once();
137 if (!gfFunctionsLoadedSuccessfully) { 137 if (!gfFunctionsLoadedSuccessfully) {
138 return nullptr; 138 return nullptr;
139 } 139 }
140 return GrGLAssembleGLESInterface(gLibrary, command_buffer_get_gl_proc); 140 return GrGLAssembleGLESInterface(gLibrary, command_buffer_get_gl_proc);
141 } 141 }
142 142
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 return result; 364 return result;
365 } 365 }
366 366
367 int CommandBufferGLTestContext::getSampleCount() { 367 int CommandBufferGLTestContext::getSampleCount() {
368 EGLint result = 0; 368 EGLint result = 0;
369 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_SAMPLES, &r esult); 369 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_SAMPLES, &r esult);
370 return result; 370 return result;
371 } 371 }
372 372
373 } // namespace sk_gpu_test 373 } // namespace sk_gpu_test
OLDNEW
« src/core/SkTaskGroup.cpp ('K') | « tests/OnceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698