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

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

Issue 1110033004: Make XPFragmentBuilder only Builder with access to DstCopy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | src/gpu/GrDefaultGeoProcFactory.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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputC olor, NULL, 542 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputC olor, NULL,
543 &fColorUniform); 543 &fColorUniform);
544 544
545 // Setup position 545 // Setup position
546 this->setupPosition(pb, gpArgs, qe.inPosition()->fName, qe.viewMatri x()); 546 this->setupPosition(pb, gpArgs, qe.inPosition()->fName, qe.viewMatri x());
547 547
548 // emit transforms 548 // emit transforms
549 this->emitTransforms(args.fPB, gpArgs->fPositionVar, qe.inPosition() ->fName, 549 this->emitTransforms(args.fPB, gpArgs->fPositionVar, qe.inPosition() ->fName,
550 qe.localMatrix(), args.fTransformsIn, args.fTra nsformsOut); 550 qe.localMatrix(), args.fTransformsIn, args.fTra nsformsOut);
551 551
552 GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilde r(); 552 GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder( );
553 553
554 SkAssertResult(fsBuilder->enableFeature( 554 SkAssertResult(fsBuilder->enableFeature(
555 GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature) ); 555 GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature) );
556 fsBuilder->codeAppendf("float edgeAlpha;"); 556 fsBuilder->codeAppendf("float edgeAlpha;");
557 557
558 // keep the derivative instructions outside the conditional 558 // keep the derivative instructions outside the conditional
559 fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn()); 559 fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn());
560 fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn()); 560 fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn());
561 fsBuilder->codeAppendf("if (%s.z > 0.0 && %s.w > 0.0) {", v.fsIn(), v.fsIn()); 561 fsBuilder->codeAppendf("if (%s.z > 0.0 && %s.w > 0.0) {", v.fsIn(), v.fsIn());
562 // today we know z and w are in device space. We could use derivativ es 562 // today we know z and w are in device space. We could use derivativ es
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 geometry.fColor = color; 885 geometry.fColor = color;
886 geometry.fViewMatrix = vm; 886 geometry.fViewMatrix = vm;
887 geometry.fPath = path; 887 geometry.fPath = path;
888 888
889 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); 889 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry));
890 target->drawBatch(pipelineBuilder, batch, &devRect); 890 target->drawBatch(pipelineBuilder, batch, &devRect);
891 891
892 return true; 892 return true;
893 893
894 } 894 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698