diff options
author | 2011-02-18 16:09:55 +0000 | |
---|---|---|
committer | 2011-02-18 16:09:55 +0000 | |
commit | 8895a7a0e222de4530e506e43eaa5e6030e8c5ed (patch) | |
tree | 1493fb4cf14a7cfaccf86a16302495d7c27d61f5 /gpu/src/GrGpuGL.h | |
parent | ce2b1afb582f0a2274f476c949cff8b0e1c72b36 (diff) |
Reduce glGets for stencil bits.
Clean up GL vs Gr rect conventions for viewport and scissor.
Review URL: http://codereview.appspot.com/4185056/
git-svn-id: http://skia.googlecode.com/svn/trunk@813 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGpuGL.h')
-rw-r--r-- | gpu/src/GrGpuGL.h | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/gpu/src/GrGpuGL.h b/gpu/src/GrGpuGL.h index a2ccc12c56..017d9ea403 100644 --- a/gpu/src/GrGpuGL.h +++ b/gpu/src/GrGpuGL.h @@ -20,6 +20,7 @@ #include "GrGpu.h" #include "GrGLConfig.h" +#include "GrGLIRect.h" #include "GrGLTexture.h" #include "GrGLVertexBuffer.h" @@ -40,6 +41,7 @@ public: virtual GrRenderTarget* createPlatformRenderTarget( intptr_t platformRenderTarget, + int stencilBits, int width, int height); virtual GrRenderTarget* createRenderTargetFrom3DApiState(); @@ -87,7 +89,11 @@ protected: void resetDirtyFlags(); // last scissor / viewport scissor state seen by the GL. - BoundsState fHWBounds; + struct { + bool fScissorEnabled; + GrGLIRect fScissorRect; + GrGLIRect fViewportRect; + } fHWBounds; GrGLExts fExts; @@ -185,31 +191,4 @@ private: typedef GrGpu INHERITED; }; -bool has_gl_extension(const char* ext); -void gl_version(int* major, int* minor); - -/** - * GrGL_RestoreResetRowLength() will reset GL_UNPACK_ROW_LENGTH to 0. We write - * this wrapper, since GL_UNPACK_ROW_LENGTH is not available on all GL versions - */ -#if GR_SUPPORT_GLDESKTOP - static inline void GrGL_RestoreResetRowLength() { - GR_GL(PixelStorei(GL_UNPACK_ROW_LENGTH, 0)); - } -#else - #define GrGL_RestoreResetRowLength() -#endif - -/* - * Some drivers want the var-int arg to be zero-initialized on input. - */ -#define GR_GL_INIT_ZERO 0 -#define GR_GL_GetIntegerv(e, p) \ - do { \ - *(p) = GR_GL_INIT_ZERO; \ - GR_GL(GetIntegerv(e, p)); \ - } while (0) - -#endif - - +#endif
\ No newline at end of file |