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

Unified Diff: include/gpu/GrEffectStage.h

Issue 12462008: Add GrEllipseEdgeEffect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rebase again Created 7 years, 9 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/GrTBackendEffectFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffectStage.h
===================================================================
--- include/gpu/GrEffectStage.h (revision 8091)
+++ include/gpu/GrEffectStage.h (working copy)
@@ -116,6 +116,7 @@
stage.fEffectRef->get()->incDeferredRefCounts();
fEffect = stage.fEffectRef->get();
fCoordChangeMatrix = stage.fCoordChangeMatrix;
+ fVertexAttribIndices = stage.fVertexAttribIndices;
}
SkDEBUGCODE(fInitialized = true;)
}
@@ -126,6 +127,7 @@
if (NULL != fEffect) {
stage->fEffectRef = GrEffect::CreateEffectRef(fEffect);
stage->fCoordChangeMatrix = fCoordChangeMatrix;
+ stage->fVertexAttribIndices = fVertexAttribIndices;
} else {
stage->fEffectRef = NULL;
}
@@ -139,16 +141,21 @@
return false;
}
- if (!(*stage.getEffect())->isEqual(*fEffect)) {
+ if (fVertexAttribIndices != stage.fVertexAttribIndices) {
return false;
}
+ if (!(*stage.getEffect())->isEqual(*fEffect)) {
+ return false;
+ }
+
return fCoordChangeMatrix == stage.fCoordChangeMatrix;
}
private:
const GrEffect* fEffect;
SkMatrix fCoordChangeMatrix;
+ SkSTArray<GrEffect::kMaxVertexAttribs, int, true> fVertexAttribIndices;
SkDEBUGCODE(bool fInitialized;)
};
@@ -162,18 +169,28 @@
GrSafeSetNull(fEffectRef);
}
- const GrEffectRef* setEffect(const GrEffectRef* EffectRef) {
+ const GrEffectRef* setEffect(const GrEffectRef* EffectRef, const int* attribIndices = NULL) {
GrAssert(0 == fSavedCoordChangeCnt);
GrSafeAssign(fEffectRef, EffectRef);
fCoordChangeMatrix.reset();
+
+ fVertexAttribIndices.reset();
+ int numVertexAttribs = (EffectRef == NULL) ? 0 : EffectRef->get()->numVertexAttribs();
+ GrAssert(numVertexAttribs == 0 || attribIndices != NULL);
+ fVertexAttribIndices.push_back_n(numVertexAttribs, attribIndices);
+
return EffectRef;
}
const GrEffectRef* getEffect() const { return fEffectRef; }
+ const int* getVertexAttribIndices() const { return fVertexAttribIndices.begin(); }
+ int getVertexAttribIndexCount() const { return fVertexAttribIndices.count(); }
+
private:
- SkMatrix fCoordChangeMatrix;
- const GrEffectRef* fEffectRef;
+ SkMatrix fCoordChangeMatrix;
+ const GrEffectRef* fEffectRef;
+ SkSTArray<2, int, true> fVertexAttribIndices;
GR_DEBUGCODE(mutable int fSavedCoordChangeCnt;)
};
« no previous file with comments | « include/gpu/GrEffect.h ('k') | include/gpu/GrTBackendEffectFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698