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

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

Issue 1213383005: Rework GrPipelineInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixed 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.fColorIgnored) { 73 if (!init.readsColor()) {
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;
77 } 75 }
76 init.getOverrideColorIfSet(&fGeoData[0].fColor);
78 77
79 // setup batch properties 78 // setup batch properties
80 fBatch.fColorIgnored = init.fColorIgnored; 79 fBatch.fColorIgnored = !init.readsColor();
81 fBatch.fColor = fGeoData[0].fColor; 80 fBatch.fColor = fGeoData[0].fColor;
82 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; 81 fBatch.fUsesLocalCoords = init.readsLocalCoords();
83 fBatch.fCoverageIgnored = init.fCoverageIgnored; 82 fBatch.fCoverageIgnored = !init.readsCoverage();
84 } 83 }
85 84
86 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override { 85 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override {
87 // Go to device coords to allow batching across matrix changes 86 // Go to device coords to allow batching across matrix changes
88 SkMatrix invert = SkMatrix::I(); 87 SkMatrix invert = SkMatrix::I();
89 88
90 // if we have a local rect, then we apply the localMatrix directly to th e localRect to 89 // if we have a local rect, then we apply the localMatrix directly to th e localRect to
91 // generate vertex local coords 90 // generate vertex local coords
92 bool hasExplicitLocalCoords = this->hasLocalRect(); 91 bool hasExplicitLocalCoords = this->hasLocalRect();
93 if (!hasExplicitLocalCoords) { 92 if (!hasExplicitLocalCoords) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 if (hasLocalMatrix) { 268 if (hasLocalMatrix) {
270 localMatrix = GrTest::TestMatrix(random); 269 localMatrix = GrTest::TestMatrix(random);
271 } 270 }
272 271
273 return GrRectBatch::Create(color, viewMatrix, rect, 272 return GrRectBatch::Create(color, viewMatrix, rect,
274 hasLocalRect ? &localRect : NULL, 273 hasLocalRect ? &localRect : NULL,
275 hasLocalMatrix ? &localMatrix : NULL); 274 hasLocalMatrix ? &localMatrix : NULL);
276 } 275 }
277 276
278 #endif 277 #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