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

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

Issue 1945353003: Revert of SK_DECLARE_STATIC_MUTEX -> static SkMutex (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « tests/PathOpsExtendedTest.cpp ('k') | tools/sk_tool_utils_font.cpp » ('j') | 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
143 // We use a poor man's garbage collector of EGLDisplays. They are only 143 // We use a poor man's garbage collector of EGLDisplays. They are only
144 // terminated when there are no more EGLDisplays in use. See crbug.com/603223 144 // terminated when there are no more EGLDisplays in use. See crbug.com/603223
145 static SkMutex gDisplayMutex; 145 SK_DECLARE_STATIC_MUTEX(gDisplayMutex);
146 static int gActiveDisplayCnt; 146 static int gActiveDisplayCnt;
147 SkTArray<EGLDisplay> gRetiredDisplays; 147 SkTArray<EGLDisplay> gRetiredDisplays;
148 148
149 static EGLDisplay get_and_init_display() { 149 static EGLDisplay get_and_init_display() {
150 SkAutoMutexAcquire am(gDisplayMutex); 150 SkAutoMutexAcquire am(gDisplayMutex);
151 EGLDisplay dsp = gfGetDisplay(EGL_DEFAULT_DISPLAY); 151 EGLDisplay dsp = gfGetDisplay(EGL_DEFAULT_DISPLAY);
152 if (dsp == EGL_NO_DISPLAY) { 152 if (dsp == EGL_NO_DISPLAY) {
153 return EGL_NO_DISPLAY; 153 return EGL_NO_DISPLAY;
154 } 154 }
155 EGLint major, minor; 155 EGLint major, minor;
(...skipping 208 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
« no previous file with comments | « tests/PathOpsExtendedTest.cpp ('k') | tools/sk_tool_utils_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698