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

Side by Side Diff: src/gpu/GrRectBatch.cpp

Issue 1213013003: Revert of Rework GrPipelineInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/GrPrimitiveProcessor.h ('k') | src/gpu/GrTessellatingPathRenderer.cpp » ('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 #include "GrRectBatch.h" 8 #include "GrRectBatch.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // When this is called on a batch, there is only one geometry bundle 63 // When this is called on a batch, there is only one geometry bundle
64 out->setKnownFourComponents(fGeoData[0].fColor); 64 out->setKnownFourComponents(fGeoData[0].fColor);
65 } 65 }
66 66
67 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { 67 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
68 out->setKnownSingleComponent(0xff); 68 out->setKnownSingleComponent(0xff);
69 } 69 }
70 70
71 void initBatchTracker(const GrPipelineInfo& init) override { 71 void initBatchTracker(const GrPipelineInfo& init) override {
72 // Handle any color overrides 72 // Handle any color overrides
73 if (!init.readsColor()) { 73 if (init.fColorIgnored) {
74 fGeoData[0].fColor = GrColor_ILLEGAL; 74 fGeoData[0].fColor = GrColor_ILLEGAL;
75 } else if (GrColor_ILLEGAL != init.fOverrideColor) {
76 fGeoData[0].fColor = init.fOverrideColor;
75 } 77 }
76 init.getOverrideColorIfSet(&fGeoData[0].fColor);
77 78
78 // setup batch properties 79 // setup batch properties
79 fBatch.fColorIgnored = !init.readsColor(); 80 fBatch.fColorIgnored = init.fColorIgnored;
80 fBatch.fColor = fGeoData[0].fColor; 81 fBatch.fColor = fGeoData[0].fColor;
81 fBatch.fUsesLocalCoords = init.readsLocalCoords(); 82 fBatch.fUsesLocalCoords = init.fUsesLocalCoords;
82 fBatch.fCoverageIgnored = !init.readsCoverage(); 83 fBatch.fCoverageIgnored = init.fCoverageIgnored;
83 } 84 }
84 85
85 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override { 86 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override {
86 // Go to device coords to allow batching across matrix changes 87 // Go to device coords to allow batching across matrix changes
87 SkMatrix invert = SkMatrix::I(); 88 SkMatrix invert = SkMatrix::I();
88 89
89 // if we have a local rect, then we apply the localMatrix directly to th e localRect to 90 // if we have a local rect, then we apply the localMatrix directly to th e localRect to
90 // generate vertex local coords 91 // generate vertex local coords
91 bool hasExplicitLocalCoords = this->hasLocalRect(); 92 bool hasExplicitLocalCoords = this->hasLocalRect();
92 if (!hasExplicitLocalCoords) { 93 if (!hasExplicitLocalCoords) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (hasLocalMatrix) { 269 if (hasLocalMatrix) {
269 localMatrix = GrTest::TestMatrix(random); 270 localMatrix = GrTest::TestMatrix(random);
270 } 271 }
271 272
272 return GrRectBatch::Create(color, viewMatrix, rect, 273 return GrRectBatch::Create(color, viewMatrix, rect,
273 hasLocalRect ? &localRect : NULL, 274 hasLocalRect ? &localRect : NULL,
274 hasLocalMatrix ? &localMatrix : NULL); 275 hasLocalMatrix ? &localMatrix : NULL);
275 } 276 }
276 277
277 #endif 278 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPrimitiveProcessor.h ('k') | src/gpu/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698