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

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

Issue 2382793002: UseSkOnce to squelch command buffer spam (Closed)
Patch Set: Just use SkOnce inlined. This is the only interesting use case right now. Created 4 years, 2 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
« no previous file with comments | « no previous file | 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698