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

Side by Side Diff: src/gpu/effects/GrBitmapTextGeoProc.cpp

Issue 2405383003: added basic dataflow analysis to skslc (Closed)
Patch Set: I have no idea what I was thinking 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 | « gyp/skia_sources.gypi ('k') | src/gpu/effects/GrXfermodeFragmentProcessor.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 2013 Google Inc. 2 * Copyright 2013 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 "GrBitmapTextGeoProc.h" 8 #include "GrBitmapTextGeoProc.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // emit transforms 56 // emit transforms
57 this->emitTransforms(vertBuilder, 57 this->emitTransforms(vertBuilder,
58 varyingHandler, 58 varyingHandler,
59 uniformHandler, 59 uniformHandler,
60 gpArgs->fPositionVar, 60 gpArgs->fPositionVar,
61 cte.inPosition()->fName, 61 cte.inPosition()->fName,
62 cte.localMatrix(), 62 cte.localMatrix(),
63 args.fFPCoordTransformHandler); 63 args.fFPCoordTransformHandler);
64 64
65 if (cte.maskFormat() == kARGB_GrMaskFormat) { 65 if (cte.maskFormat() == kARGB_GrMaskFormat) {
66 fragBuilder->codeAppendf("%s = ", args.fOutputColor); 66 if (!cte.colorIgnored()) {
67 fragBuilder->appendTextureLookupAndModulate(args.fOutputColor, 67 fragBuilder->codeAppendf("%s = ", args.fOutputColor);
68 args.fTexSamplers[0], 68 fragBuilder->appendTextureLookupAndModulate(args.fOutputColor,
69 v.fsIn(), 69 args.fTexSamplers[0] ,
70 kVec2f_GrSLType); 70 v.fsIn(),
71 fragBuilder->codeAppend(";"); 71 kVec2f_GrSLType);
72 fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage); 72 fragBuilder->codeAppend(";");
73 fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage);
74 }
73 } else { 75 } else {
74 fragBuilder->codeAppendf("%s = ", args.fOutputCoverage); 76 fragBuilder->codeAppendf("%s = ", args.fOutputCoverage);
75 fragBuilder->appendTextureLookup(args.fTexSamplers[0], v.fsIn(), kVe c2f_GrSLType); 77 fragBuilder->appendTextureLookup(args.fTexSamplers[0], v.fsIn(), kVe c2f_GrSLType);
76 fragBuilder->codeAppend(";"); 78 fragBuilder->codeAppend(";");
77 if (cte.maskFormat() == kA565_GrMaskFormat) { 79 if (cte.maskFormat() == kA565_GrMaskFormat) {
78 // set alpha to be max of rgb coverage 80 // set alpha to be max of rgb coverage
79 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", 81 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);",
80 args.fOutputCoverage, args.fOutputCover age, 82 args.fOutputCoverage, args.fOutputCover age,
81 args.fOutputCoverage, args.fOutputCover age); 83 args.fOutputCoverage, args.fOutputCover age);
82 } 84 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 break; 184 break;
183 case 2: 185 case 2:
184 format = kARGB_GrMaskFormat; 186 format = kARGB_GrMaskFormat;
185 break; 187 break;
186 } 188 }
187 189
188 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), d->fTextures[tex Idx], params, 190 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), d->fTextures[tex Idx], params,
189 format, GrTest::TestMatrix(d->fRandom), 191 format, GrTest::TestMatrix(d->fRandom),
190 d->fRandom->nextBool()); 192 d->fRandom->nextBool());
191 } 193 }
OLDNEW
« no previous file with comments | « gyp/skia_sources.gypi ('k') | src/gpu/effects/GrXfermodeFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698