| 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 "GrNinePatch.h" | 8 #include "GrNinePatch.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 fGeoData[i].fCenter.fLeft, fGeoData[i].fCenter.fTop, | 67 fGeoData[i].fCenter.fLeft, fGeoData[i].fCenter.fTop, |
| 68 fGeoData[i].fCenter.fRight, fGeoData[i].fCenter.fBottom, | 68 fGeoData[i].fCenter.fRight, fGeoData[i].fCenter.fBottom, |
| 69 fGeoData[i].fDst.fLeft, fGeoData[i].fDst.fTop, | 69 fGeoData[i].fDst.fLeft, fGeoData[i].fDst.fTop, |
| 70 fGeoData[i].fDst.fRight, fGeoData[i].fDst.fBottom); | 70 fGeoData[i].fDst.fRight, fGeoData[i].fDst.fBottom); |
| 71 } | 71 } |
| 72 | 72 |
| 73 str.append(INHERITED::dumpInfo()); | 73 str.append(INHERITED::dumpInfo()); |
| 74 return str; | 74 return str; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 77 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant
Output* coverage, |
| 78 out->setUnknownFourComponents(); | 78 bool* usePLSDstRead) const { |
| 79 } | 79 color->setUnknownFourComponents(); |
| 80 | 80 coverage->setKnownSingleComponent(0xff); |
| 81 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 81 *usePLSDstRead = false; |
| 82 out->setKnownSingleComponent(0xff); | |
| 83 } | 82 } |
| 84 | 83 |
| 85 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 84 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
| 86 | 85 |
| 87 private: | 86 private: |
| 88 void onPrepareDraws(Target* target) override { | 87 void onPrepareDraws(Target* target) override { |
| 89 SkAutoTUnref<const GrGeometryProcessor> gp(create_gp(fOpts.readsCoverage
())); | 88 SkAutoTUnref<const GrGeometryProcessor> gp(create_gp(fOpts.readsCoverage
())); |
| 90 if (!gp) { | 89 if (!gp) { |
| 91 SkDebugf("Couldn't create GrGeometryProcessor\n"); | 90 SkDebugf("Couldn't create GrGeometryProcessor\n"); |
| 92 return; | 91 return; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 174 |
| 176 typedef GrVertexBatch INHERITED; | 175 typedef GrVertexBatch INHERITED; |
| 177 }; | 176 }; |
| 178 | 177 |
| 179 namespace GrNinePatch { | 178 namespace GrNinePatch { |
| 180 GrDrawBatch* CreateNonAA(GrColor color, const SkMatrix& viewMatrix, int imageWid
th, int imageHeight, | 179 GrDrawBatch* CreateNonAA(GrColor color, const SkMatrix& viewMatrix, int imageWid
th, int imageHeight, |
| 181 const SkIRect& center, const SkRect& dst) { | 180 const SkIRect& center, const SkRect& dst) { |
| 182 return new GrNonAANinePatchBatch(color, viewMatrix, imageWidth, imageHeight,
center, dst); | 181 return new GrNonAANinePatchBatch(color, viewMatrix, imageWidth, imageHeight,
center, dst); |
| 183 } | 182 } |
| 184 }; | 183 }; |
| OLD | NEW |