Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: src/gpu/GrOptDrawState.h

Issue 742853002: Don't use NULL GrOptDrawState to indicate that draw should be skipped. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: save other file Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrOptDrawState.h
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h
index 0bb3d07f89351603a7c7f4a4d750ada3fe096379..a81093dfb0d0afc281fbd24e339c26d6370f5728 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(); }
/// @}
@@ -201,14 +195,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

Powered by Google App Engine
This is Rietveld 408576698