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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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
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
11 #include "gl/SkMesaGLContext.h" 11 #include "gl/SkMesaGLContext.h"
12 #include "gl/GrGLDefines.h" 12 #include "gl/GrGLDefines.h"
13 13
14 SkMesaGLContext::AutoContextRestore::AutoContextRestore() { 14 SkMesaGLContext::AutoContextRestore::AutoContextRestore() {
15 fOldContext = (Context)OSMesaGetCurrentContext(); 15 fOldContext = (Context)OSMesaGetCurrentContext();
16 if (NULL != (OSMesaContext)fOldContext) { 16 if (fOldContext) {
17 OSMesaGetColorBuffer((OSMesaContext)fOldContext, 17 OSMesaGetColorBuffer((OSMesaContext)fOldContext,
18 &fOldWidth, &fOldHeight, 18 &fOldWidth, &fOldHeight,
19 &fOldFormat, &fOldImage); 19 &fOldFormat, &fOldImage);
20 } 20 }
21 } 21 }
22 22
23 SkMesaGLContext::AutoContextRestore::~AutoContextRestore() { 23 SkMesaGLContext::AutoContextRestore::~AutoContextRestore() {
24 if (NULL != (OSMesaContext)fOldContext) { 24 if (fOldContext) {
25 OSMesaMakeCurrent((OSMesaContext)fOldContext, fOldImage, 25 OSMesaMakeCurrent((OSMesaContext)fOldContext, fOldImage,
26 fOldFormat, fOldWidth, fOldHeight); 26 fOldFormat, fOldWidth, fOldHeight);
27 } 27 }
28 } 28 }
29 29
30 /////////////////////////////////////////////////////////////////////////////// 30 ///////////////////////////////////////////////////////////////////////////////
31 31
32 SkMesaGLContext::SkMesaGLContext() 32 SkMesaGLContext::SkMesaGLContext()
33 : fContext(static_cast<Context>(NULL)) 33 : fContext(static_cast<Context>(NULL))
34 , fImage(NULL) { 34 , fImage(NULL) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void SkMesaGLContext::makeCurrent() const { 103 void SkMesaGLContext::makeCurrent() const {
104 if (fContext) { 104 if (fContext) {
105 if (!OSMesaMakeCurrent((OSMesaContext)fContext, fImage, 105 if (!OSMesaMakeCurrent((OSMesaContext)fContext, fImage,
106 GR_GL_UNSIGNED_BYTE, gBOGUS_SIZE, gBOGUS_SIZE)) { 106 GR_GL_UNSIGNED_BYTE, gBOGUS_SIZE, gBOGUS_SIZE)) {
107 SkDebugf("Could not make MESA context current."); 107 SkDebugf("Could not make MESA context current.");
108 } 108 }
109 } 109 }
110 } 110 }
111 111
112 void SkMesaGLContext::swapBuffers() const { } 112 void SkMesaGLContext::swapBuffers() const { }
OLDNEW
« no previous file with comments | « src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp ('k') | src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698