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 24 matching lines...) Expand all Loading... |
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; | 44 void initBatchTracker(const GrPipelineOptimizations&) override; |
45 void generateGeometry(GrBatchTarget* batchTarget) override; | |
46 | 45 |
47 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 46 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
48 | 47 |
49 private: | 48 private: |
| 49 void onPrepareDraws(Target*) override; |
| 50 |
50 GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int s
priteCount, | 51 GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int s
priteCount, |
51 const SkRSXform* xforms, const SkRect* rects, const SkColor
* colors); | 52 const SkRSXform* xforms, const SkRect* rects, const SkColor
* colors); |
52 | 53 |
53 GrColor color() const { return fColor; } | 54 GrColor color() const { return fColor; } |
54 bool colorIgnored() const { return fColorIgnored; } | 55 bool colorIgnored() const { return fColorIgnored; } |
55 const SkMatrix& viewMatrix() const { return fViewMatrix; } | 56 const SkMatrix& viewMatrix() const { return fViewMatrix; } |
56 bool hasColors() const { return fHasColors; } | 57 bool hasColors() const { return fHasColors; } |
57 int quadCount() const { return fQuadCount; } | 58 int quadCount() const { return fQuadCount; } |
58 bool coverageIgnored() const { return fCoverageIgnored; } | 59 bool coverageIgnored() const { return fCoverageIgnored; } |
59 | 60 |
60 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override; | 61 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override; |
61 SkSTArray<1, Geometry, true> fGeoData; | 62 SkSTArray<1, Geometry, true> fGeoData; |
62 | 63 |
63 SkMatrix fViewMatrix; | 64 SkMatrix fViewMatrix; |
64 GrColor fColor; | 65 GrColor fColor; |
65 int fQuadCount; | 66 int fQuadCount; |
66 bool fColorIgnored; | 67 bool fColorIgnored; |
67 bool fCoverageIgnored; | 68 bool fCoverageIgnored; |
68 bool fHasColors; | 69 bool fHasColors; |
69 }; | 70 }; |
70 | 71 |
71 #endif | 72 #endif |
OLD | NEW |