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 #ifndef GrDrawAtlasBatch_DEFINED | 8 #ifndef GrDrawAtlasBatch_DEFINED |
9 #define GrDrawAtlasBatch_DEFINED | 9 #define GrDrawAtlasBatch_DEFINED |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 if (this->hasColors()) { | 33 if (this->hasColors()) { |
34 out->setUnknownFourComponents(); | 34 out->setUnknownFourComponents(); |
35 } else { | 35 } else { |
36 out->setKnownFourComponents(fGeoData[0].fColor); | 36 out->setKnownFourComponents(fGeoData[0].fColor); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 40 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
41 out->setKnownSingleComponent(0xff); | 41 out->setKnownSingleComponent(0xff); |
42 } | 42 } |
43 | 43 |
44 void initBatchTracker(const GrPipelineOptimizations&) override; | |
45 | |
46 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 44 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
47 | 45 |
48 private: | 46 private: |
49 void onPrepareDraws(Target*) override; | 47 void onPrepareDraws(Target*) override; |
50 | 48 |
| 49 void initBatchTracker(const GrPipelineOptimizations&) override; |
| 50 |
51 GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int s
priteCount, | 51 GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int s
priteCount, |
52 const SkRSXform* xforms, const SkRect* rects, const SkColor
* colors); | 52 const SkRSXform* xforms, const SkRect* rects, const SkColor
* colors); |
53 | 53 |
54 GrColor color() const { return fColor; } | 54 GrColor color() const { return fColor; } |
55 bool colorIgnored() const { return fColorIgnored; } | 55 bool colorIgnored() const { return fColorIgnored; } |
56 const SkMatrix& viewMatrix() const { return fViewMatrix; } | 56 const SkMatrix& viewMatrix() const { return fViewMatrix; } |
57 bool hasColors() const { return fHasColors; } | 57 bool hasColors() const { return fHasColors; } |
58 int quadCount() const { return fQuadCount; } | 58 int quadCount() const { return fQuadCount; } |
59 bool coverageIgnored() const { return fCoverageIgnored; } | 59 bool coverageIgnored() const { return fCoverageIgnored; } |
60 | 60 |
61 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override; | 61 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override; |
62 SkSTArray<1, Geometry, true> fGeoData; | 62 SkSTArray<1, Geometry, true> fGeoData; |
63 | 63 |
64 SkMatrix fViewMatrix; | 64 SkMatrix fViewMatrix; |
65 GrColor fColor; | 65 GrColor fColor; |
66 int fQuadCount; | 66 int fQuadCount; |
67 bool fColorIgnored; | 67 bool fColorIgnored; |
68 bool fCoverageIgnored; | 68 bool fCoverageIgnored; |
69 bool fHasColors; | 69 bool fHasColors; |
70 }; | 70 }; |
71 | 71 |
72 #endif | 72 #endif |
OLD | NEW |