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

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: Make bool cast work 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
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOptDrawState.h
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h
index b727cb5442de04e9a7a86bdc829754f574836052..91c39a181cdc56ec286f275399f5893afe8a236d 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
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698