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

Side by Side Diff: src/gpu/batches/GrDrawAtlasBatch.h

Issue 1467553002: New API for computing optimization invariants. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
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 11 matching lines...) Expand all
22 }; 22 };
23 23
24 static GrDrawBatch* Create(const Geometry& geometry, const SkMatrix& viewMat rix, 24 static GrDrawBatch* Create(const Geometry& geometry, const SkMatrix& viewMat rix,
25 int spriteCount, const SkRSXform* xforms, const S kRect* rects, 25 int spriteCount, const SkRSXform* xforms, const S kRect* rects,
26 const SkColor* colors) { 26 const SkColor* colors) {
27 return new GrDrawAtlasBatch(geometry, viewMatrix, spriteCount, xforms, r ects, colors); 27 return new GrDrawAtlasBatch(geometry, viewMatrix, spriteCount, xforms, r ects, colors);
28 } 28 }
29 29
30 const char* name() const override { return "DrawAtlasBatch"; } 30 const char* name() const override { return "DrawAtlasBatch"; }
31 31
32 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { 32 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant Output* coverage,
33 bool* usePLSDstRead) const override {
33 // When this is called on a batch, there is only one geometry bundle 34 // When this is called on a batch, there is only one geometry bundle
34 if (this->hasColors()) { 35 if (this->hasColors()) {
35 out->setUnknownFourComponents(); 36 color->setUnknownFourComponents();
36 } else { 37 } else {
37 out->setKnownFourComponents(fGeoData[0].fColor); 38 color->setKnownFourComponents(fGeoData[0].fColor);
38 } 39 }
39 } 40 coverage->setKnownSingleComponent(0xff);
40 41 *usePLSDstRead = false;
41 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
42 out->setKnownSingleComponent(0xff);
43 } 42 }
44 43
45 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } 44 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
46 45
47 private: 46 private:
48 void onPrepareDraws(Target*) override; 47 void onPrepareDraws(Target*) override;
49 48
50 void initBatchTracker(const GrPipelineOptimizations&) override; 49 void initBatchTracker(const GrPipelineOptimizations&) override;
51 50
52 GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int s priteCount, 51 GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int s priteCount,
(...skipping 13 matching lines...) Expand all
66 GrColor fColor; 65 GrColor fColor;
67 int fQuadCount; 66 int fQuadCount;
68 bool fColorIgnored; 67 bool fColorIgnored;
69 bool fCoverageIgnored; 68 bool fCoverageIgnored;
70 bool fHasColors; 69 bool fHasColors;
71 70
72 typedef GrVertexBatch INHERITED; 71 typedef GrVertexBatch INHERITED;
73 }; 72 };
74 73
75 #endif 74 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698