Chromium Code Reviews| Index: src/gpu/GrDrawTarget.h |
| diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h |
| index 2da63d80ad4ec8b8bc9f3ad6cbace90b5f474f67..cd3bf94ec26a8d68ed15b09c62bab968a069ff49 100644 |
| --- a/src/gpu/GrDrawTarget.h |
| +++ b/src/gpu/GrDrawTarget.h |
| @@ -8,7 +8,7 @@ |
| #ifndef GrDrawTarget_DEFINED |
| #define GrDrawTarget_DEFINED |
| -#include "GrClipData.h" |
| +#include "GrClip.h" |
| #include "GrClipMaskManager.h" |
| #include "GrContext.h" |
| #include "GrPathProcessor.h" |
| @@ -29,7 +29,7 @@ |
| #include "SkXfermode.h" |
| class GrBatch; |
| -class GrClipData; |
| +class GrClip; |
| class GrDrawTargetCaps; |
| class GrPath; |
| class GrPathRange; |
| @@ -55,23 +55,6 @@ public: |
| const GrDrawTargetCaps* caps() const { return fCaps.get(); } |
| /** |
| - * Sets the current clip to the region specified by clip. All draws will be |
| - * clipped against this clip if kClip_StateBit is enabled. |
| - * |
| - * Setting the clip may (or may not) zero out the client's stencil bits. |
| - * |
| - * @param description of the clipping region |
| - */ |
| - void setClip(const GrClipData* clip); |
| - |
| - /** |
| - * Gets the current clip. |
| - * |
| - * @return the clip. |
| - */ |
| - const GrClipData* getClip() const; |
| - |
| - /** |
| * There are two types of "sources" of geometry (vertices and indices) for |
| * draw calls made on the target. When performing an indexed draw, the |
| * indices and vertices can use different source types. Once a source is |
| @@ -264,9 +247,7 @@ public: |
| const SkRect* devBounds = NULL); |
| // TODO devbounds should live on the batch |
| - void drawBatch(GrPipelineBuilder*, |
| - GrBatch*, |
| - const SkRect* devBounds = NULL); |
| + void drawBatch(GrPipelineBuilder*, GrBatch*, const SkRect* devBounds = NULL); |
| /** |
| * Draws path into the stencil buffer. The fill must be either even/odd or |
| @@ -274,14 +255,18 @@ public: |
| * on the GrPipelineBuilder (if possible in the 3D API). Note, we will never have an inverse |
| * fill with stencil path |
| */ |
| - void stencilPath(GrPipelineBuilder*, const GrPathProcessor*, const GrPath*, |
| + void stencilPath(GrPipelineBuilder*, |
| + const GrPathProcessor*, |
| + const GrPath*, |
| GrPathRendering::FillType); |
| /** |
| * Draws a path. Fill must not be a hairline. It will respect the HW |
| * antialias flag on the GrPipelineBuilder (if possible in the 3D API). |
| */ |
| - void drawPath(GrPipelineBuilder*, const GrPathProcessor*, const GrPath*, |
| + void drawPath(GrPipelineBuilder*, |
| + const GrPathProcessor*, |
| + const GrPath*, |
| GrPathRendering::FillType); |
| /** |
| @@ -332,11 +317,15 @@ public: |
| /** |
| * Helper for drawRect when the caller doesn't need separate local rects or matrices. |
| */ |
| - void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& viewM, |
| + void drawSimpleRect(GrPipelineBuilder* ds, |
| + GrColor color, |
| + const SkMatrix& viewM, |
| const SkRect& rect) { |
| this->drawRect(ds, color, viewM, rect, NULL, NULL); |
| } |
| - void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& viewM, |
| + void drawSimpleRect(GrPipelineBuilder* ds, |
|
bsalomon
2015/02/23 19:31:29
A lot of the lines in this change are just wrappin
|
| + GrColor color, |
| + const SkMatrix& viewM, |
| const SkIRect& irect) { |
| SkRect rect = SkRect::Make(irect); |
| this->drawRect(ds, color, viewM, rect, NULL, NULL); |
| @@ -475,27 +464,6 @@ public: |
| //////////////////////////////////////////////////////////////////////////// |
| - class AutoClipRestore : public ::SkNoncopyable { |
| - public: |
| - AutoClipRestore(GrDrawTarget* target) { |
| - fTarget = target; |
| - fClip = fTarget->getClip(); |
| - } |
| - |
| - AutoClipRestore(GrDrawTarget* target, const SkIRect& newClip); |
| - |
| - ~AutoClipRestore() { |
| - fTarget->setClip(fClip); |
| - } |
| - private: |
| - GrDrawTarget* fTarget; |
| - const GrClipData* fClip; |
| - SkTLazy<SkClipStack> fStack; |
| - GrClipData fReplacementClip; |
| - }; |
| - |
| - //////////////////////////////////////////////////////////////////////////// |
| - |
| /** |
| * Saves the geometry src state at construction and restores in the destructor. It also saves |
| * and then restores the vertex attrib state. |
| @@ -688,11 +656,12 @@ protected: |
| struct PipelineInfo { |
| PipelineInfo(GrPipelineBuilder* pipelineBuilder, GrScissorState* scissor, |
| - const GrPrimitiveProcessor* primProc, const SkRect* devBounds, |
| - GrDrawTarget* target); |
| + const GrPrimitiveProcessor* primProc, |
| + const SkRect* devBounds, GrDrawTarget* target); |
| PipelineInfo(GrPipelineBuilder* pipelineBuilder, GrScissorState* scissor, |
| - const GrBatch* batch, const SkRect* devBounds, GrDrawTarget* target); |
| + const GrBatch* batch, const SkRect* devBounds, |
| + GrDrawTarget* target); |
| bool willBlendWithDst(const GrPrimitiveProcessor* primProc) const { |
| return fPipelineBuilder->willBlendWithDst(primProc); |
| @@ -838,7 +807,6 @@ private: |
| kPreallocGeoSrcStateStackCnt = 4, |
| }; |
| SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcStateStack; |
| - const GrClipData* fClip; |
| // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTarget. |
| GrContext* fContext; |
| // To keep track that we always have at least as many debug marker adds as removes |