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

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

Issue 1780933003: Use std::unique_ptr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: once more, all together Created 4 years, 9 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/core/SkRefCnt.h ('k') | include/private/SkOncePtr.h » ('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 SkGLContext_DEFINED 8 #ifndef SkGLContext_DEFINED
9 #define SkGLContext_DEFINED 9 #define SkGLContext_DEFINED
10 10
11 #include "GrGLInterface.h" 11 #include "GrGLInterface.h"
12 #include "../private/SkGpuFenceSync.h" 12 #include "../private/SkGpuFenceSync.h"
13 13
14 /** 14 /**
15 * Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO. 15 * Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO.
16 * Provides a GrGLInterface struct of function pointers for the context. 16 * Provides a GrGLInterface struct of function pointers for the context.
17 * This class is intended for Skia's testing needs and not for general 17 * This class is intended for Skia's testing needs and not for general
18 * use. 18 * use.
19 */ 19 */
20 class SK_API SkGLContext : public SkNoncopyable { 20 class SK_API SkGLContext : public SkNoncopyable {
21 public: 21 public:
22 virtual ~SkGLContext(); 22 virtual ~SkGLContext();
23 23
24 bool isValid() const { return NULL != gl(); } 24 bool isValid() const { return NULL != gl(); }
25 25
26 const GrGLInterface* gl() const { return fGL.get(); } 26 const GrGLInterface* gl() const { return fGL.get(); }
27 27
28 bool fenceSyncSupport() const { return SkToBool(fFenceSync); } 28 bool fenceSyncSupport() const { return fFenceSync != nullptr; }
29 29
30 bool getMaxGpuFrameLag(int* maxFrameLag) const { 30 bool getMaxGpuFrameLag(int* maxFrameLag) const {
31 if (!fFenceSync) { 31 if (!fFenceSync) {
32 return false; 32 return false;
33 } 33 }
34 *maxFrameLag = kMaxFrameLag; 34 *maxFrameLag = kMaxFrameLag;
35 return true; 35 return true;
36 } 36 }
37 37
38 void makeCurrent() const; 38 void makeCurrent() const;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 * SK_GL(glCtx, GenTextures(1, &texID)); 136 * SK_GL(glCtx, GenTextures(1, &texID));
137 */ 137 */
138 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ 138 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \
139 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) 139 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError())
140 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ 140 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \
141 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) 141 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError())
142 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X 142 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X
143 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X 143 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X
144 144
145 #endif 145 #endif
OLDNEW
« no previous file with comments | « include/core/SkRefCnt.h ('k') | include/private/SkOncePtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698