OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 "gl/angle/SkANGLEGLContext.h" | 9 #include "gl/angle/SkANGLEGLContext.h" |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 SkDebugf("Could not create ANGLE GL interface!\n"); | 116 SkDebugf("Could not create ANGLE GL interface!\n"); |
117 this->destroyGLContext(); | 117 this->destroyGLContext(); |
118 return; | 118 return; |
119 } | 119 } |
120 if (!gl->validate()) { | 120 if (!gl->validate()) { |
121 SkDebugf("Could not validate ANGLE GL interface!\n"); | 121 SkDebugf("Could not validate ANGLE GL interface!\n"); |
122 this->destroyGLContext(); | 122 this->destroyGLContext(); |
123 return; | 123 return; |
124 } | 124 } |
125 | 125 |
126 this->init(gl.detach()); | 126 this->init(gl.release()); |
127 } | 127 } |
128 | 128 |
129 SkANGLEGLContext::~SkANGLEGLContext() { | 129 SkANGLEGLContext::~SkANGLEGLContext() { |
130 this->teardown(); | 130 this->teardown(); |
131 this->destroyGLContext(); | 131 this->destroyGLContext(); |
132 } | 132 } |
133 | 133 |
134 GrEGLImage SkANGLEGLContext::texture2DToEGLImage(GrGLuint texID) const { | 134 GrEGLImage SkANGLEGLContext::texture2DToEGLImage(GrGLuint texID) const { |
135 if (!this->gl()->hasExtension("EGL_KHR_gl_texture_2D_image")) { | 135 if (!this->gl()->hasExtension("EGL_KHR_gl_texture_2D_image")) { |
136 return GR_EGL_NO_IMAGE; | 136 return GR_EGL_NO_IMAGE; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 void SkANGLEGLContext::onPlatformSwapBuffers() const { | 220 void SkANGLEGLContext::onPlatformSwapBuffers() const { |
221 if (!eglSwapBuffers(fDisplay, fSurface)) { | 221 if (!eglSwapBuffers(fDisplay, fSurface)) { |
222 SkDebugf("Could not complete eglSwapBuffers.\n"); | 222 SkDebugf("Could not complete eglSwapBuffers.\n"); |
223 } | 223 } |
224 } | 224 } |
225 | 225 |
226 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const { | 226 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const { |
227 return eglGetProcAddress(name); | 227 return eglGetProcAddress(name); |
228 } | 228 } |
OLD | NEW |