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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 glEGLImageTargetTexture2D(GR_GL_TEXTURE_EXTERNAL, image); | 174 glEGLImageTargetTexture2D(GR_GL_TEXTURE_EXTERNAL, image); |
175 if (GR_GL_GET_ERROR(this->gl()) != GR_GL_NO_ERROR) { | 175 if (GR_GL_GET_ERROR(this->gl()) != GR_GL_NO_ERROR) { |
176 GR_GL_CALL(this->gl(), DeleteTextures(1, &texID)); | 176 GR_GL_CALL(this->gl(), DeleteTextures(1, &texID)); |
177 return 0; | 177 return 0; |
178 } | 178 } |
179 return texID; | 179 return texID; |
180 } | 180 } |
181 | 181 |
182 SkGLContext* SkANGLEGLContext::createNew() const { | 182 SkGLContext* SkANGLEGLContext::createNew() const { |
183 SkGLContext* ctx = SkANGLEGLContext::Create(this->gl()->fStandard, fIsGLBack
end); | 183 #ifdef SK_BUILD_FOR_WIN |
| 184 SkGLContext* ctx = fIsGLBackend ? SkANGLEGLContext::CreateOpenGL() |
| 185 : kANGLEGLContext::CreateDirectX(); |
| 186 #else |
| 187 SkGLContext* ctx = SkANGLEGLContext::CreateOpenGL(); |
| 188 #endif |
184 if (ctx) { | 189 if (ctx) { |
185 ctx->makeCurrent(); | 190 ctx->makeCurrent(); |
186 } | 191 } |
187 return ctx; | 192 return ctx; |
188 } | 193 } |
189 | 194 |
190 void SkANGLEGLContext::destroyGLContext() { | 195 void SkANGLEGLContext::destroyGLContext() { |
191 if (fDisplay) { | 196 if (fDisplay) { |
192 eglMakeCurrent(fDisplay, 0, 0, 0); | 197 eglMakeCurrent(fDisplay, 0, 0, 0); |
193 | 198 |
(...skipping 20 matching lines...) Expand all Loading... |
214 | 219 |
215 void SkANGLEGLContext::onPlatformSwapBuffers() const { | 220 void SkANGLEGLContext::onPlatformSwapBuffers() const { |
216 if (!eglSwapBuffers(fDisplay, fSurface)) { | 221 if (!eglSwapBuffers(fDisplay, fSurface)) { |
217 SkDebugf("Could not complete eglSwapBuffers.\n"); | 222 SkDebugf("Could not complete eglSwapBuffers.\n"); |
218 } | 223 } |
219 } | 224 } |
220 | 225 |
221 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const { | 226 GrGLFuncPtr SkANGLEGLContext::onPlatformGetProcAddress(const char* name) const { |
222 return eglGetProcAddress(name); | 227 return eglGetProcAddress(name); |
223 } | 228 } |
OLD | NEW |