diff options
author | 2014-11-20 09:56:11 -0800 | |
---|---|---|
committer | 2014-11-20 09:56:11 -0800 | |
commit | b03c4a35bd319d883925a39871b4972ff1b2c0cc (patch) | |
tree | cf06d14e7274276bc830822f6cd28140acdc811f /src/gpu/GrOptDrawState.h | |
parent | 08d1fccf6eeec0a9fd5421e59e4d05daccf6e339 (diff) |
Don't use NULL GrOptDrawState to indicate that draw should be skipped.
Review URL: https://codereview.chromium.org/742853002
Diffstat (limited to 'src/gpu/GrOptDrawState.h')
-rw-r--r-- | src/gpu/GrOptDrawState.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h index b727cb5442..91c39a181c 100644 --- a/src/gpu/GrOptDrawState.h +++ b/src/gpu/GrOptDrawState.h @@ -30,15 +30,8 @@ public: typedef GrClipMaskManager::ScissorState ScissorState; - /** - * Returns a snapshot of the current optimized state. The GrOptDrawState is reffed and ownership - * is given to the caller. - */ - static GrOptDrawState* Create(const GrDrawState& drawState, - GrGpu*, - const ScissorState&, - const GrDeviceCoordTexture* dstCopy, - GrGpu::DrawType drawType); + GrOptDrawState(const GrDrawState& drawState, GrGpu*, const ScissorState&, + const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType); bool operator== (const GrOptDrawState& that) const; bool operator!= (const GrOptDrawState& that) const { return !(*this == that); } @@ -182,6 +175,7 @@ public: bool isDitherState() const { return SkToBool(fFlags & kDither_Flag); } bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); } bool isColorWriteDisabled() const { return SkToBool(fFlags & kDisableColorWrite_Flag); } + bool mustSkip() const { return NULL == this->getRenderTarget(); } /// @} @@ -202,14 +196,6 @@ public: private: /** - * Constructs and optimized drawState out of a GrRODrawState. - */ - GrOptDrawState(const GrDrawState& drawState, GrDrawState::BlendOpt, - GrBlendCoeff optSrcCoeff, GrBlendCoeff optDstCoeff, - GrGpu*, const ScissorState&, const GrDeviceCoordTexture* dstCopy, - GrGpu::DrawType); - - /** * Loops through all the color stage effects to check if the stage will ignore color input or * always output a constant color. In the ignore color input case we can ignore all previous * stages. In the constant color case, we can ignore all previous stages and |