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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 configAttribs[12] = EGL_NONE; | 178 configAttribs[12] = EGL_NONE; |
179 } | 179 } |
180 | 180 |
181 initializeGLContext(nativeWindow, configAttribs, surfaceAttribs); | 181 initializeGLContext(nativeWindow, configAttribs, surfaceAttribs); |
182 } | 182 } |
183 | 183 |
184 void CommandBufferGLTestContext::initializeGLContext(void *nativeWindow, const i
nt *configAttribs, | 184 void CommandBufferGLTestContext::initializeGLContext(void *nativeWindow, const i
nt *configAttribs, |
185 const int *surfaceAttribs) { | 185 const int *surfaceAttribs) { |
186 load_command_buffer_once(); | 186 load_command_buffer_once(); |
187 if (!gfFunctionsLoadedSuccessfully) { | 187 if (!gfFunctionsLoadedSuccessfully) { |
188 SkDebugf("Command Buffer: Could not load EGL functions.\n"); | 188 static SkOnce once; |
| 189 once([] { SkDebugf("Command Buffer: Could not load EGL functions.\n"); }
); |
189 return; | 190 return; |
190 } | 191 } |
191 | 192 |
192 fDisplay = gfGetDisplay(EGL_DEFAULT_DISPLAY); | 193 fDisplay = gfGetDisplay(EGL_DEFAULT_DISPLAY); |
193 if (EGL_NO_DISPLAY == fDisplay) { | 194 if (EGL_NO_DISPLAY == fDisplay) { |
194 SkDebugf("Command Buffer: Could not create EGL display.\n"); | 195 SkDebugf("Command Buffer: Could not create EGL display.\n"); |
195 return; | 196 return; |
196 } | 197 } |
197 if (!gfInitialize(fDisplay, nullptr, nullptr)) { | 198 if (!gfInitialize(fDisplay, nullptr, nullptr)) { |
198 SkDebugf("Command Buffer: Could not initialize EGL display.\n"); | 199 SkDebugf("Command Buffer: Could not initialize EGL display.\n"); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 return result; | 328 return result; |
328 } | 329 } |
329 | 330 |
330 int CommandBufferGLTestContext::getSampleCount() { | 331 int CommandBufferGLTestContext::getSampleCount() { |
331 EGLint result = 0; | 332 EGLint result = 0; |
332 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_SAMPLES, &r
esult); | 333 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_SAMPLES, &r
esult); |
333 return result; | 334 return result; |
334 } | 335 } |
335 | 336 |
336 } // namespace sk_gpu_test | 337 } // namespace sk_gpu_test |
OLD | NEW |