aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-16 18:03:03 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-16 18:03:03 +0000
commit1e945b7e708c633d4aed937ebfce57d52ba21d83 (patch)
tree1d27847d9e7a6f32137b6a3025c5d17f58a8c2c8 /src/gpu/GrGpu.h
parent13eaaaa75a16fa300fa212ec910107f77530ef2c (diff)
Minor refactoring to pull GrClipMaskManager into its own files
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h61
1 files changed, 1 insertions, 60 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 7bba3558a0..de14935e7f 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -14,6 +14,7 @@
#include "GrRect.h"
#include "GrRefCnt.h"
#include "GrTexture.h"
+#include "GrClipMaskManager.h"
class GrContext;
class GrIndexBufferAllocPool;
@@ -51,66 +52,6 @@ struct GrGpuStats {
uint32_t fRenderTargetCreateCnt;
};
-/**
- * Scissoring needs special handling during stencil clip mask creation
- * since the creation process re-entrantly invokes setupClipAndFlushState.
- * During this process the call stack is used to keep
- * track of (and apply to the GPU) the current scissor settings.
- */
-struct ScissoringSettings {
- bool fEnableScissoring;
- GrIRect fScissorRect;
-
- void setupScissoring(GrGpu* gpu);
-};
-
-/**
- * The clip mask creator handles the generation of the clip mask. If anti
- * aliasing is requested it will (in the future) generate a single channel
- * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit
- * mask in the stencil buffer. In the non anti-aliasing case, if the clip
- * mask can be represented as a rectangle then scissoring is used. In all
- * cases scissoring is used to bound the range of the clip mask.
- */
-class GrClipMaskManager {
-public:
- GrClipMaskManager()
- : fClipMaskInStencil(false)
- , fPathRendererChain(NULL) {
- }
-
- bool createClipMask(GrGpu* gpu,
- const GrClip& clip,
- ScissoringSettings* scissorSettings);
-
- void freeResources();
-
- bool isClipInStencil() const { return fClipMaskInStencil; }
-
- void resetMask() {
- fClipMaskInStencil = false;
- }
-
-protected:
-private:
- bool fClipMaskInStencil; // is the clip mask in the stencil buffer?
-
- // must be instantiated after GrGpu object has been given its owning
- // GrContext ptr. (GrGpu is constructed first then handed off to GrContext).
- GrPathRendererChain* fPathRendererChain;
-
- bool createStencilClipMask(GrGpu* gpu,
- const GrClip& clip,
- const GrRect& bounds,
- ScissoringSettings* scissorSettings);
-
- // determines the path renderer used to draw a clip path element.
- GrPathRenderer* getClipPathRenderer(GrGpu* gpu,
- const SkPath& path,
- GrPathFill fill);
-
-};
-
class GrGpu : public GrDrawTarget {
public: