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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 554833002: Calculate Primary and Secondary output types in the GrOptDrawState (Closed) Base URL: https://skia.googlesource.com/skia.git@optReadDst
Patch Set: Fix comment nits Created 6 years, 3 months 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/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index f6397446658b588c0043acbf58024b1e5cbfdde1..0833f0b95dac7097c0f8c5172147f2943d29bd0e 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -7,24 +7,24 @@
#include "GrDrawState.h"
-#include "GrDrawTargetCaps.h"
#include "GrOptDrawState.h"
#include "GrPaint.h"
//////////////////////////////////////////////////////////////////////////////s
-GrOptDrawState* GrDrawState::createOptState() const {
- if (NULL == fCachedOptState) {
+GrOptDrawState* GrDrawState::createOptState(const GrDrawTargetCaps* caps) const {
+ if (NULL == fCachedOptState || caps != fCachedCaps.get()) {
GrBlendCoeff srcCoeff;
GrBlendCoeff dstCoeff;
BlendOptFlags blendFlags = this->getBlendOpts(false, &srcCoeff, &dstCoeff);
- fCachedOptState = SkNEW_ARGS(GrOptDrawState, (*this, blendFlags, srcCoeff, dstCoeff));
+ fCachedOptState = SkNEW_ARGS(GrOptDrawState, (*this, blendFlags, srcCoeff, dstCoeff, *caps));
+ fCachedCaps.reset(SkRef(caps));
} else {
#ifdef SK_DEBUG
GrBlendCoeff srcCoeff;
GrBlendCoeff dstCoeff;
BlendOptFlags blendFlags = this->getBlendOpts(false, &srcCoeff, &dstCoeff);
- SkASSERT(GrOptDrawState(*this, blendFlags, srcCoeff, dstCoeff) == *fCachedOptState);
+ SkASSERT(GrOptDrawState(*this, blendFlags, srcCoeff, dstCoeff, *caps) == *fCachedOptState);
#endif
}
fCachedOptState->ref();
« src/gpu/GrDrawState.h ('K') | « src/gpu/GrDrawState.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698