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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.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/gl/builders/GrGLNvprProgramBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 13a14534cf42b03c8fe50f8b29b06d4bf7737605..c414aba9ff3603d559de9521293998cbd1c2e9f0 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -277,7 +277,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs,
const char* inColor) {
GrGLInstalledFragProc* ifp = SkNEW(GrGLInstalledFragProc);
- const GrFragmentProcessor& fp = *fs.getProcessor();
+ const GrFragmentProcessor& fp = *fs.processor();
ifp->fGLProc.reset(fp.createGLInstance());
SkSTArray<4, GrGLProcessor::TextureSampler> samplers(fp.numTextures());
@@ -372,7 +372,7 @@ void GrGLProgramBuilder::verify(const GrFragmentProcessor& fp) {
void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage,
GrGLProcessor::TransformedCoordsArray* outCoords,
GrGLInstalledFragProc* ifp) {
- const GrFragmentProcessor* processor = stage.getProcessor();
+ const GrFragmentProcessor* processor = stage.processor();
int numTransforms = processor->numTransforms();
ifp->fTransforms.push_back_n(numTransforms);
@@ -380,20 +380,14 @@ void GrGLProgramBuilder::emitTransforms(const GrPendingFragmentStage& stage,
const char* uniName = "StageMatrix";
GrSLType varyingType;
- // TODO when we have deleted the coord change matrices we can get rid of the below check
GrCoordSet coordType = processor->coordTransform(t).sourceCoords();
const SkMatrix& localMatrix = fOptState.getPrimitiveProcessor()->localMatrix();
- if (localMatrix.isIdentity()) {
- varyingType = stage.isPerspectiveCoordTransform(t) ? kVec3f_GrSLType :
- kVec2f_GrSLType;
- } else {
- uint32_t type = processor->coordTransform(t).getMatrix().getType();
- if (kLocal_GrCoordSet == coordType) {
- type |= localMatrix.getType();
- }
- varyingType = SkToBool(SkMatrix::kPerspective_Mask & type) ? kVec3f_GrSLType :
- kVec2f_GrSLType;
+ uint32_t type = processor->coordTransform(t).getMatrix().getType();
+ if (kLocal_GrCoordSet == coordType) {
+ type |= localMatrix.getType();
}
+ varyingType = SkToBool(SkMatrix::kPerspective_Mask & type) ? kVec3f_GrSLType :
+ kVec2f_GrSLType;
GrSLPrecision precision = processor->coordTransform(t).precision();
SkString suffixedUniName;
« no previous file with comments | « src/gpu/gl/builders/GrGLNvprProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698