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 #include "SkOnce.h" | 8 #include "SkOnce.h" |
9 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "gl/GrGLAssembleInterface.h" | 10 #include "gl/GrGLAssembleInterface.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 SkDebugf("Command Buffer: Could not create CommandBuffer GL interface.\n
"); | 252 SkDebugf("Command Buffer: Could not create CommandBuffer GL interface.\n
"); |
253 this->destroyGLContext(); | 253 this->destroyGLContext(); |
254 return; | 254 return; |
255 } | 255 } |
256 if (!gl->validate()) { | 256 if (!gl->validate()) { |
257 SkDebugf("Command Buffer: Could not validate CommandBuffer GL interface.
\n"); | 257 SkDebugf("Command Buffer: Could not validate CommandBuffer GL interface.
\n"); |
258 this->destroyGLContext(); | 258 this->destroyGLContext(); |
259 return; | 259 return; |
260 } | 260 } |
261 | 261 |
262 this->init(gl.detach()); | 262 this->init(gl.release()); |
263 } | 263 } |
264 | 264 |
265 SkCommandBufferGLContext::~SkCommandBufferGLContext() { | 265 SkCommandBufferGLContext::~SkCommandBufferGLContext() { |
266 this->teardown(); | 266 this->teardown(); |
267 this->destroyGLContext(); | 267 this->destroyGLContext(); |
268 } | 268 } |
269 | 269 |
270 void SkCommandBufferGLContext::destroyGLContext() { | 270 void SkCommandBufferGLContext::destroyGLContext() { |
271 if (!gfFunctionsLoadedSuccessfully) { | 271 if (!gfFunctionsLoadedSuccessfully) { |
272 return; | 272 return; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 EGLint result = 0; | 330 EGLint result = 0; |
331 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_STENCIL_SIZ
E, &result); | 331 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_STENCIL_SIZ
E, &result); |
332 return result; | 332 return result; |
333 } | 333 } |
334 | 334 |
335 int SkCommandBufferGLContext::getSampleCount() { | 335 int SkCommandBufferGLContext::getSampleCount() { |
336 EGLint result = 0; | 336 EGLint result = 0; |
337 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_SAMPLES, &r
esult); | 337 gfGetConfigAttrib(fDisplay, static_cast<EGLConfig>(fConfig), EGL_SAMPLES, &r
esult); |
338 return result; | 338 return result; |
339 } | 339 } |
OLD | NEW |