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

Side by Side Diff: src/gpu/gl/android/SkNativeGLContext_android.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
« no previous file with comments | « src/gpu/gl/SkGLContextHelper.cpp ('k') | src/gpu/gl/angle/GrGLCreateANGLEInterface.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 #include "gl/SkNativeGLContext.h" 8 #include "gl/SkNativeGLContext.h"
9 9
10 SkNativeGLContext::AutoContextRestore::AutoContextRestore() { 10 SkNativeGLContext::AutoContextRestore::AutoContextRestore() {
11 fOldEGLContext = eglGetCurrentContext(); 11 fOldEGLContext = eglGetCurrentContext();
12 fOldDisplay = eglGetCurrentDisplay(); 12 fOldDisplay = eglGetCurrentDisplay();
13 fOldSurface = eglGetCurrentSurface(EGL_DRAW); 13 fOldSurface = eglGetCurrentSurface(EGL_DRAW);
14 14
15 } 15 }
16 16
17 SkNativeGLContext::AutoContextRestore::~AutoContextRestore() { 17 SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
18 if (NULL != fOldDisplay) { 18 if (fOldDisplay) {
19 eglMakeCurrent(fOldDisplay, fOldSurface, fOldSurface, fOldEGLContext); 19 eglMakeCurrent(fOldDisplay, fOldSurface, fOldSurface, fOldEGLContext);
20 } 20 }
21 } 21 }
22 22
23 /////////////////////////////////////////////////////////////////////////////// 23 ///////////////////////////////////////////////////////////////////////////////
24 24
25 SkNativeGLContext::SkNativeGLContext() 25 SkNativeGLContext::SkNativeGLContext()
26 : fContext(EGL_NO_CONTEXT) 26 : fContext(EGL_NO_CONTEXT)
27 , fDisplay(EGL_NO_DISPLAY) 27 , fDisplay(EGL_NO_DISPLAY)
28 , fSurface(EGL_NO_SURFACE) { 28 , fSurface(EGL_NO_SURFACE) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) { 173 if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) {
174 SkDebugf("Could not set the context.\n"); 174 SkDebugf("Could not set the context.\n");
175 } 175 }
176 } 176 }
177 177
178 void SkNativeGLContext::swapBuffers() const { 178 void SkNativeGLContext::swapBuffers() const {
179 if (!eglSwapBuffers(fDisplay, fSurface)) { 179 if (!eglSwapBuffers(fDisplay, fSurface)) {
180 SkDebugf("Could not complete eglSwapBuffers.\n"); 180 SkDebugf("Could not complete eglSwapBuffers.\n");
181 } 181 }
182 } 182 }
OLDNEW
« no previous file with comments | « src/gpu/gl/SkGLContextHelper.cpp ('k') | src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698