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

Side by Side Diff: src/gpu/batches/GrAAConvexPathRenderer.cpp

Issue 2437063002: re-re-land of skslc now automatically turns on derivatives support (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/batches/GrPLSPathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrAAConvexPathRenderer.h" 8 #include "GrAAConvexPathRenderer.h"
9 9
10 #include "GrAAConvexTessellator.h" 10 #include "GrAAConvexTessellator.h"
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 572
573 // emit transforms 573 // emit transforms
574 this->emitTransforms(vertBuilder, 574 this->emitTransforms(vertBuilder,
575 varyingHandler, 575 varyingHandler,
576 uniformHandler, 576 uniformHandler,
577 gpArgs->fPositionVar, 577 gpArgs->fPositionVar,
578 qe.inPosition()->fName, 578 qe.inPosition()->fName,
579 qe.localMatrix(), 579 qe.localMatrix(),
580 args.fFPCoordTransformHandler); 580 args.fFPCoordTransformHandler);
581 581
582 SkAssertResult(fragBuilder->enableFeature(
583 GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeatur e));
584 fragBuilder->codeAppendf("float edgeAlpha;"); 582 fragBuilder->codeAppendf("float edgeAlpha;");
585 583
586 // keep the derivative instructions outside the conditional 584 // keep the derivative instructions outside the conditional
587 fragBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn()); 585 fragBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn());
588 fragBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn()); 586 fragBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn());
589 fragBuilder->codeAppendf("if (%s.z > 0.0 && %s.w > 0.0) {", v.fsIn() , v.fsIn()); 587 fragBuilder->codeAppendf("if (%s.z > 0.0 && %s.w > 0.0) {", v.fsIn() , v.fsIn());
590 // today we know z and w are in device space. We could use derivativ es 588 // today we know z and w are in device space. We could use derivativ es
591 fragBuilder->codeAppendf("edgeAlpha = min(min(%s.z, %s.w) + 0.5, 1.0 );", v.fsIn(), 589 fragBuilder->codeAppendf("edgeAlpha = min(min(%s.z, %s.w) + 0.5, 1.0 );", v.fsIn(),
592 v.fsIn()); 590 v.fsIn());
593 fragBuilder->codeAppendf ("} else {"); 591 fragBuilder->codeAppendf ("} else {");
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 1008
1011 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { 1009 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) {
1012 GrColor color = GrRandomColor(random); 1010 GrColor color = GrRandomColor(random);
1013 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); 1011 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random);
1014 SkPath path = GrTest::TestPathConvex(random); 1012 SkPath path = GrTest::TestPathConvex(random);
1015 1013
1016 return new AAConvexPathBatch(color, viewMatrix, path); 1014 return new AAConvexPathBatch(color, viewMatrix, path);
1017 } 1015 }
1018 1016
1019 #endif 1017 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/batches/GrPLSPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698