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

Unified Diff: src/gpu/gl/GrGLProgram.cpp

Issue 821243003: removing coord change matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@no-coordchange-on-drawstate
Patch Set: rebase Created 6 years 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/GrProcOptInfo.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgram.cpp
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 245086db6c7275f359ca032b98bd2775fed2fa19..60d97a296976985ff5149a2d01dffbca2df7a85e 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -30,24 +30,12 @@
static SkMatrix get_transform_matrix(const GrPendingFragmentStage& stage,
int transformIdx,
const SkMatrix& localMatrix) {
- const GrCoordTransform& coordTransform = stage.getProcessor()->coordTransform(transformIdx);
+ const GrCoordTransform& coordTransform = stage.processor()->coordTransform(transformIdx);
SkMatrix combined;
+ // We only apply the localmatrix to localcoords
if (kLocal_GrCoordSet == coordTransform.sourceCoords()) {
- // If we have explicit local coords or are in device coords then we shouldn't need a coord
- // change.
- // TODO shortly we will get rid of coord change matrices entirely, and the PrimProc will
- // always have a local matrix, often Identity, which can be used to transform coord
- // transforms. Until we actually do this, we need some way for a PrimProc to say 'use my
- // matrix' instead of the coord change mechanism. Temporarily, we have overloaded
- // The identity matrix to be this value, ie if a primproc has an identity matrix for a
- // local matrix then use the coord change matrix, otherwise use the matrix on the primproc
- if (localMatrix.isIdentity()) {
- const SkMatrix& ccm = stage.getCoordChangeMatrix();
- combined.setConcat(coordTransform.getMatrix(), ccm);
- } else {
- combined.setConcat(coordTransform.getMatrix(), localMatrix);
- }
+ combined.setConcat(coordTransform.getMatrix(), localMatrix);
} else {
combined = coordTransform.getMatrix();
}
@@ -190,7 +178,7 @@ void GrGLProgram::setFragmentData(const GrOptDrawState& optState) {
int numProcessors = fFragmentProcessors->fProcs.count();
for (int e = 0; e < numProcessors; ++e) {
const GrPendingFragmentStage& stage = optState.getFragmentStage(e);
- const GrProcessor& processor = *stage.getProcessor();
+ const GrProcessor& processor = *stage.processor();
fFragmentProcessors->fProcs[e]->fGLProc->setData(fProgramDataManager, processor);
const SkMatrix& localMatrix = optState.getPrimitiveProcessor()->localMatrix();
this->setTransformData(stage, localMatrix, fFragmentProcessors->fProcs[e]);
@@ -202,7 +190,7 @@ void GrGLProgram::setTransformData(const GrPendingFragmentStage& processor,
GrGLInstalledFragProc* ip) {
SkTArray<GrGLInstalledFragProc::Transform, true>& transforms = ip->fTransforms;
int numTransforms = transforms.count();
- SkASSERT(numTransforms == processor.getProcessor()->numTransforms());
+ SkASSERT(numTransforms == processor.processor()->numTransforms());
for (int t = 0; t < numTransforms; ++t) {
SkASSERT(transforms[t].fHandle.isValid());
const SkMatrix& matrix = get_transform_matrix(processor, t, localMatrix);
@@ -309,7 +297,7 @@ void GrGLNvprProgram::setTransformData(const GrPendingFragmentStage& proc,
GrGLInstalledFragProc* ip) {
SkTArray<GrGLInstalledFragProc::Transform, true>& transforms = ip->fTransforms;
int numTransforms = transforms.count();
- SkASSERT(numTransforms == proc.getProcessor()->numTransforms());
+ SkASSERT(numTransforms == proc.processor()->numTransforms());
for (int t = 0; t < numTransforms; ++t) {
SkASSERT(transforms[t].fHandle.isValid());
const SkMatrix& transform = get_transform_matrix(proc, t, localMatrix);
@@ -354,7 +342,7 @@ GrGLLegacyNvprProgram::setTransformData(const GrPendingFragmentStage& proc,
GrGLInstalledFragProc* ip) {
// We've hidden the texcoord index in the first entry of the transforms array for each effect
int texCoordIndex = ip->fTransforms[0].fHandle.handle();
- int numTransforms = proc.getProcessor()->numTransforms();
+ int numTransforms = proc.processor()->numTransforms();
for (int t = 0; t < numTransforms; ++t) {
const SkMatrix& transform = get_transform_matrix(proc, t, localMatrix);
GrGLPathRendering::PathTexGenComponents components =
« no previous file with comments | « src/gpu/GrProcOptInfo.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698