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

Side by Side Diff: include/gpu/gl/SkGLContextHelper.h

Issue 422323002: Some fixes around GrContext::abandonContext: (Closed) Base URL: https://skia.googlesource.com/skia.git@abandon
Patch Set: Address comments Created 6 years, 4 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 | « include/gpu/gl/SkDebugGLContext.h ('k') | src/gpu/GrContext.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 2013 Google Inc. 3 * Copyright 2013 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 #ifndef SkGLContextHelper_DEFINED 8 #ifndef SkGLContextHelper_DEFINED
9 #define SkGLContextHelper_DEFINED 9 #define SkGLContextHelper_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 * targeted. If the current surface does not include a back buffer, this 43 * targeted. If the current surface does not include a back buffer, this
44 * call has no effect. 44 * call has no effect.
45 */ 45 */
46 virtual void swapBuffers() const = 0; 46 virtual void swapBuffers() const = 0;
47 47
48 bool hasExtension(const char* extensionName) const { 48 bool hasExtension(const char* extensionName) const {
49 SkASSERT(NULL != fGL); 49 SkASSERT(NULL != fGL);
50 return fGL->hasExtension(extensionName); 50 return fGL->hasExtension(extensionName);
51 } 51 }
52 52
53 /**
54 * This notifies the context that we are deliberately testing abandoning
55 * the context. It is useful for debugging contexts that would otherwise
56 * test that GPU resources are properly deleted. It also allows a debugging
57 * context to test that further GL calls are not made by Skia GPU code.
58 */
59 void testAbandon();
60
53 protected: 61 protected:
54 /** 62 /**
55 * Subclass implements this to make a GL context. The returned GrGLInterface 63 * Subclass implements this to make a GL context. The returned GrGLInterface
56 * should be populated with functions compatible with the context. The 64 * should be populated with functions compatible with the context. The
57 * format and size of backbuffers does not matter since an FBO will be 65 * format and size of backbuffers does not matter since an FBO will be
58 * created. 66 * created.
59 */ 67 */
60 virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) = 0; 68 virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) = 0;
61 69
62 /** 70 /**
(...skipping 15 matching lines...) Expand all
78 * SK_GL(glCtx, GenTextures(1, &texID)); 86 * SK_GL(glCtx, GenTextures(1, &texID));
79 */ 87 */
80 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ 88 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \
81 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) 89 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError())
82 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ 90 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \
83 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) 91 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError())
84 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X 92 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X
85 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X 93 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X
86 94
87 #endif 95 #endif
OLDNEW
« no previous file with comments | « include/gpu/gl/SkDebugGLContext.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698