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

Side by Side Diff: src/gpu/gl/mesa/SkMesaGLContext.cpp

Issue 351583002: Revert of Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « src/gpu/gl/mac/SkNativeGLContext_mac.cpp ('k') | src/gpu/gl/nacl/SkNativeGLContext_nacl.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 2011 Google Inc. 3 * Copyright 2011 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/osmesa.h> 9 #include <GL/osmesa.h>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 if (fContext) { 48 if (fContext) {
49 OSMesaDestroyContext((OSMesaContext)fContext); 49 OSMesaDestroyContext((OSMesaContext)fContext);
50 fContext = static_cast<Context>(NULL); 50 fContext = static_cast<Context>(NULL);
51 } 51 }
52 } 52 }
53 53
54 static const GrGLint gBOGUS_SIZE = 16; 54 static const GrGLint gBOGUS_SIZE = 16;
55 55
56 const GrGLInterface* SkMesaGLContext::createGLContext(GrGLStandard forcedGpuAPI) { 56 const GrGLInterface* SkMesaGLContext::createGLContext() {
57 if (kGLES_GrGLStandard == forcedGpuAPI) {
58 return NULL;
59 }
60
61 /* Create an RGBA-mode context */ 57 /* Create an RGBA-mode context */
62 #if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305 58 #if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305
63 /* specify Z, stencil, accum sizes */ 59 /* specify Z, stencil, accum sizes */
64 fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, NULL); 60 fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, NULL);
65 #else 61 #else
66 fContext = (Context)OSMesaCreateContext(OSMESA_BGRA, NULL); 62 fContext = (Context)OSMesaCreateContext(OSMESA_BGRA, NULL);
67 #endif 63 #endif
68 if (!fContext) { 64 if (!fContext) {
69 SkDebugf("OSMesaCreateContext failed!\n"); 65 SkDebugf("OSMesaCreateContext failed!\n");
70 this->destroyGLContext(); 66 this->destroyGLContext();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void SkMesaGLContext::makeCurrent() const { 99 void SkMesaGLContext::makeCurrent() const {
104 if (fContext) { 100 if (fContext) {
105 if (!OSMesaMakeCurrent((OSMesaContext)fContext, fImage, 101 if (!OSMesaMakeCurrent((OSMesaContext)fContext, fImage,
106 GR_GL_UNSIGNED_BYTE, gBOGUS_SIZE, gBOGUS_SIZE)) { 102 GR_GL_UNSIGNED_BYTE, gBOGUS_SIZE, gBOGUS_SIZE)) {
107 SkDebugf("Could not make MESA context current."); 103 SkDebugf("Could not make MESA context current.");
108 } 104 }
109 } 105 }
110 } 106 }
111 107
112 void SkMesaGLContext::swapBuffers() const { } 108 void SkMesaGLContext::swapBuffers() const { }
OLDNEW
« no previous file with comments | « src/gpu/gl/mac/SkNativeGLContext_mac.cpp ('k') | src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698