OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrAAFillRectBatch.h" | 8 #include "GrAAFillRectBatch.h" |
9 | 9 |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 coverageType = Coverage::kSolid_Type; | 34 coverageType = Coverage::kSolid_Type; |
35 } else { | 35 } else { |
36 coverageType = Coverage::kAttribute_Type; | 36 coverageType = Coverage::kAttribute_Type; |
37 } | 37 } |
38 Coverage coverage(coverageType); | 38 Coverage coverage(coverageType); |
39 LocalCoords localCoords(usesLocalCoords ? LocalCoords::kUsePosition_Type : | 39 LocalCoords localCoords(usesLocalCoords ? LocalCoords::kUsePosition_Type : |
40 LocalCoords::kUnused_Type); | 40 LocalCoords::kUnused_Type); |
41 return CreateForDeviceSpace(color, coverage, localCoords, viewMatrix); | 41 return CreateForDeviceSpace(color, coverage, localCoords, viewMatrix); |
42 } | 42 } |
43 | 43 |
44 void GrAAFillRectBatch::initBatchTracker(const GrPipelineInfo& init) { | 44 void GrAAFillRectBatch::initBatchTracker(const GrPipelineOptimizations& opt) { |
45 // Handle any color overrides | 45 // Handle any color overrides |
46 if (!init.readsColor()) { | 46 if (!opt.readsColor()) { |
47 fGeoData[0].fColor = GrColor_ILLEGAL; | 47 fGeoData[0].fColor = GrColor_ILLEGAL; |
48 } | 48 } |
49 init.getOverrideColorIfSet(&fGeoData[0].fColor); | 49 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
50 | 50 |
51 // setup batch properties | 51 // setup batch properties |
52 fBatch.fColorIgnored = !init.readsColor(); | 52 fBatch.fColorIgnored = !opt.readsColor(); |
53 fBatch.fColor = fGeoData[0].fColor; | 53 fBatch.fColor = fGeoData[0].fColor; |
54 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 54 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); |
55 fBatch.fCoverageIgnored = !init.readsCoverage(); | 55 fBatch.fCoverageIgnored = !opt.readsCoverage(); |
56 fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); | 56 fBatch.fCanTweakAlphaForCoverage = opt.canTweakAlphaForCoverage(); |
57 } | 57 } |
58 | 58 |
59 void GrAAFillRectBatch::generateGeometry(GrBatchTarget* batchTarget) { | 59 void GrAAFillRectBatch::generateGeometry(GrBatchTarget* batchTarget) { |
60 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); | 60 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
61 | 61 |
62 SkAutoTUnref<const GrGeometryProcessor> gp(create_fill_rect_gp(canTweakAlpha
ForCoverage, | 62 SkAutoTUnref<const GrGeometryProcessor> gp(create_fill_rect_gp(canTweakAlpha
ForCoverage, |
63 this->viewMat
rix(), | 63 this->viewMat
rix(), |
64 this->usesLoc
alCoords(), | 64 this->usesLoc
alCoords(), |
65 this->coverag
eIgnored())); | 65 this->coverag
eIgnored())); |
66 if (!gp) { | 66 if (!gp) { |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 BATCH_TEST_DEFINE(AAFillRectBatch) { | 250 BATCH_TEST_DEFINE(AAFillRectBatch) { |
251 GrAAFillRectBatch::Geometry geo; | 251 GrAAFillRectBatch::Geometry geo; |
252 geo.fColor = GrRandomColor(random); | 252 geo.fColor = GrRandomColor(random); |
253 geo.fViewMatrix = GrTest::TestMatrix(random); | 253 geo.fViewMatrix = GrTest::TestMatrix(random); |
254 geo.fRect = GrTest::TestRect(random); | 254 geo.fRect = GrTest::TestRect(random); |
255 geo.fDevRect = GrTest::TestRect(random); | 255 geo.fDevRect = GrTest::TestRect(random); |
256 return GrAAFillRectBatch::Create(geo); | 256 return GrAAFillRectBatch::Create(geo); |
257 } | 257 } |
258 | 258 |
259 #endif | 259 #endif |
OLD | NEW |