| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |