diff options
author | 2011-08-02 14:07:52 +0000 | |
---|---|---|
committer | 2011-08-02 14:07:52 +0000 | |
commit | a16d6506bde44f8528e681a49c412a1e87b74482 (patch) | |
tree | 865944bcaa727facfb99b32c5d7a433c4c0fc146 /gpu/src/GrGpuGL.h | |
parent | 9b540ced413604481ff842678cc6b8db621e81da (diff) |
Create a separate GrStencilBuffer class apart from GrRenderTarget.
Review URL: http://codereview.appspot.com/4837046/
git-svn-id: http://skia.googlecode.com/svn/trunk@2026 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGpuGL.h')
-rw-r--r-- | gpu/src/GrGpuGL.h | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/gpu/src/GrGpuGL.h b/gpu/src/GrGpuGL.h index 59e32cf5ae..6dbc9d7dd5 100644 --- a/gpu/src/GrGpuGL.h +++ b/gpu/src/GrGpuGL.h @@ -12,11 +12,11 @@ #define GrGpuGL_DEFINED #include "GrGpu.h" +#include "GrGLIndexBuffer.h" #include "GrGLIRect.h" +#include "GrGLStencilBuffer.h" #include "GrGLTexture.h" - #include "GrGLVertexBuffer.h" -#include "GrGLIndexBuffer.h" #include "SkString.h" @@ -69,8 +69,9 @@ protected: } fHWBounds; // GrGpu overrides - // overrides from GrGpu virtual void resetContext(); + virtual void abandonResources(); + virtual void releaseResources(); virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, const void* srcData, @@ -81,6 +82,10 @@ protected: bool dynamic); virtual GrResource* onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc); virtual GrRenderTarget* onCreateRenderTargetFrom3DApiState(); + virtual bool createStencilBufferForRenderTarget(GrRenderTarget* rt, + int width, int height); + virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer* sb, + GrRenderTarget* rt); virtual void onClear(const GrIRect* rect, GrColor color); @@ -173,12 +178,16 @@ private: GrGLenum* internalFormat, GrGLenum* format, GrGLenum* type); - // helper for onCreateTexture + // helpers for onCreateTexture void allocateAndUploadTexData(const GrGLTexture::Desc& desc, GrGLenum internalFormat, const void* data, size_t rowBytes); + bool createRenderTargetObjects(int width, int height, + GrGLuint texID, + GrGLRenderTarget::Desc* desc); + bool fboInternalFormat(GrPixelConfig config, GrGLenum* format); friend class GrGLVertexBuffer; @@ -186,16 +195,13 @@ private: friend class GrGLTexture; friend class GrGLRenderTarget; - static const GrGLuint gUNKNOWN_BITCOUNT = ~0; - - struct StencilFormat { - GrGLenum fEnum; - GrGLuint fBits; - bool fPacked; - }; - - GrTArray<StencilFormat, true> fStencilFormats; + GrTArray<GrGLStencilBuffer::Format, true> fStencilFormats; + // we want to clear stencil buffers when they are created. We want to clear + // the entire buffer even if it is larger than the color attachment. We + // attach it to this fbo with no color attachment to do the initial clear. + GrGLuint fStencilClearFBO; + bool fHWBlendDisabled; GrGLuint fAASamples[4]; |