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

Unified Diff: include/gpu/GrEffectStage.h

Issue 372053003: Revert of Make GrDrawState and GrPaint take GrEffect* instead of GrEffectRef*. (Closed) Base URL: https://skia.googlesource.com/skia.git@no_ref
Patch Set: Created 6 years, 5 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
« no previous file with comments | « include/gpu/GrEffect.h ('k') | include/gpu/GrEffectUnitTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffectStage.h
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index fb0620d6e6df097ca1f15ef7f1961b1c22373aef..84ccbbf091dd6ccfa7a82d4412360336f891629d 100644
--- a/include/gpu/GrEffectStage.h
+++ b/include/gpu/GrEffectStage.h
@@ -20,8 +20,8 @@
class GrEffectStage {
public:
- explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attrIndex1 = -1)
- : fEffect(SkRef(effect)) {
+ explicit GrEffectStage(const GrEffectRef* effectRef, int attrIndex0 = -1, int attrIndex1 = -1)
+ : fEffectRef(SkRef(effectRef)) {
fCoordChangeMatrixSet = false;
fVertexAttribIndices[0] = attrIndex0;
fVertexAttribIndices[1] = attrIndex1;
@@ -36,14 +36,14 @@
if (other.fCoordChangeMatrixSet) {
fCoordChangeMatrix = other.fCoordChangeMatrix;
}
- fEffect.reset(SkRef(other.fEffect.get()));
+ fEffectRef.reset(SkRef(other.fEffectRef.get()));
memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexAttribIndices));
return *this;
}
bool operator== (const GrEffectStage& other) const {
- SkASSERT(NULL != fEffect.get());
- SkASSERT(NULL != other.fEffect.get());
+ SkASSERT(NULL != fEffectRef.get());
+ SkASSERT(NULL != other.fEffectRef.get());
if (!this->getEffect()->isEqual(*other.getEffect())) {
return false;
@@ -81,7 +81,7 @@
private:
bool fCoordChangeMatrixSet;
SkMatrix fCoordChangeMatrix;
- SkDEBUGCODE(mutable SkAutoTUnref<const GrEffect> fEffect;)
+ SkDEBUGCODE(mutable SkAutoTUnref<const GrEffectRef> fEffectRef;)
friend class GrEffectStage;
};
@@ -97,9 +97,9 @@
if (fCoordChangeMatrixSet) {
savedCoordChange->fCoordChangeMatrix = fCoordChangeMatrix;
}
- SkASSERT(NULL == savedCoordChange->fEffect.get());
- SkDEBUGCODE(SkRef(fEffect.get());)
- SkDEBUGCODE(savedCoordChange->fEffect.reset(fEffect.get());)
+ SkASSERT(NULL == savedCoordChange->fEffectRef.get());
+ SkDEBUGCODE(SkRef(fEffectRef.get());)
+ SkDEBUGCODE(savedCoordChange->fEffectRef.reset(fEffectRef.get());)
}
/**
@@ -110,8 +110,8 @@
if (fCoordChangeMatrixSet) {
fCoordChangeMatrix = savedCoordChange.fCoordChangeMatrix;
}
- SkASSERT(savedCoordChange.fEffect.get() == fEffect);
- SkDEBUGCODE(savedCoordChange.fEffect.reset(NULL);)
+ SkASSERT(savedCoordChange.fEffectRef.get() == fEffectRef);
+ SkDEBUGCODE(savedCoordChange.fEffectRef.reset(NULL);)
}
/**
@@ -126,15 +126,15 @@
}
}
- const GrEffect* getEffect() const { return fEffect.get(); }
+ const GrEffect* getEffect() const { return fEffectRef.get()->get(); }
const int* getVertexAttribIndices() const { return fVertexAttribIndices; }
- int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs(); }
+ int getVertexAttribIndexCount() const { return fEffectRef->get()->numVertexAttribs(); }
private:
bool fCoordChangeMatrixSet;
SkMatrix fCoordChangeMatrix;
- SkAutoTUnref<const GrEffect> fEffect;
+ SkAutoTUnref<const GrEffectRef> fEffectRef;
int fVertexAttribIndices[2];
};
« no previous file with comments | « include/gpu/GrEffect.h ('k') | include/gpu/GrEffectUnitTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698