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

Side by Side Diff: src/gpu/GrTestBatch.h

Issue 1139723004: Preliminary attempt to remove batch tracker (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup5
Patch Set: tweaks Created 5 years, 7 months 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
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 GrTestBatch_DEFINED 8 #ifndef GrTestBatch_DEFINED
9 #define GrTestBatch_DEFINED 9 #define GrTestBatch_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // setup batch properties 43 // setup batch properties
44 fBatch.fColorIgnored = init.fColorIgnored; 44 fBatch.fColorIgnored = init.fColorIgnored;
45 fBatch.fColor = this->geoData(0)->fColor; 45 fBatch.fColor = this->geoData(0)->fColor;
46 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; 46 fBatch.fUsesLocalCoords = init.fUsesLocalCoords;
47 fBatch.fCoverageIgnored = init.fCoverageIgnored; 47 fBatch.fCoverageIgnored = init.fCoverageIgnored;
48 } 48 }
49 49
50 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override { 50 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override {
51 batchTarget->initDraw(fGeometryProcessor, pipeline); 51 batchTarget->initDraw(fGeometryProcessor, pipeline);
52 52
53 // TODO this is hacky, but the only way we have to initialize the GP is to use the
54 // GrPipelineInfo struct so we can generate the correct shader. Once we have GrBatch
55 // everywhere we can remove this nastiness
56 GrPipelineInfo init;
57 init.fColorIgnored = fBatch.fColorIgnored;
58 init.fOverrideColor = GrColor_ILLEGAL;
59 init.fCoverageIgnored = fBatch.fCoverageIgnored;
60 init.fUsesLocalCoords = fBatch.fUsesLocalCoords;
61 fGeometryProcessor->initBatchTracker(batchTarget->currentBatchTracker(), init);
62
63 this->onGenerateGeometry(batchTarget, pipeline); 53 this->onGenerateGeometry(batchTarget, pipeline);
64 } 54 }
65 55
66 protected: 56 protected:
67 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) { 57 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) {
68 fGeometryProcessor.reset(SkRef(gp)); 58 fGeometryProcessor.reset(SkRef(gp));
69 59
70 this->setBounds(bounds); 60 this->setBounds(bounds);
71 } 61 }
72 62
(...skipping 14 matching lines...) Expand all
87 bool fUsesLocalCoords; 77 bool fUsesLocalCoords;
88 bool fColorIgnored; 78 bool fColorIgnored;
89 bool fCoverageIgnored; 79 bool fCoverageIgnored;
90 }; 80 };
91 81
92 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; 82 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor;
93 BatchTracker fBatch; 83 BatchTracker fBatch;
94 }; 84 };
95 85
96 #endif 86 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698