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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 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 |