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

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

Issue 876673002: Hairline batch (Closed) Base URL: https://skia.googlesource.com/skia.git@2_defer
Patch Set: cleanup Created 5 years, 10 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/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrBatch.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 2012 Google Inc. 2 * Copyright 2012 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 "GrAARectRenderer.h" 8 #include "GrAARectRenderer.h"
9 #include "GrBatch.h" 9 #include "GrBatch.h"
10 #include "GrBatchTarget.h" 10 #include "GrBatchTarget.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 bool onCombineIfPossible(GrBatch* t) SK_OVERRIDE { 201 bool onCombineIfPossible(GrBatch* t) SK_OVERRIDE {
202 AAFillRectBatch* that = t->cast<AAFillRectBatch>(); 202 AAFillRectBatch* that = t->cast<AAFillRectBatch>();
203 if (this->canTweakAlphaForCoverage() != that->canTweakAlphaForCoverage() ) { 203 if (this->canTweakAlphaForCoverage() != that->canTweakAlphaForCoverage() ) {
204 return false; 204 return false;
205 } 205 }
206 206
207 if (this->colorIgnored() != that->colorIgnored()) { 207 if (this->colorIgnored() != that->colorIgnored()) {
208 return false; 208 return false;
209 } 209 }
210 210
211 if (this->usesLocalCoords() != that->usesLocalCoords()) { 211 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords());
212 return false;
213 }
214
215 // We apply the viewmatrix to the rect points on the cpu. However, if t he pipeline uses 212 // We apply the viewmatrix to the rect points on the cpu. However, if t he pipeline uses
216 // local coords then we won't be able to batch. We could actually uploa d the viewmatrix 213 // local coords then we won't be able to batch. We could actually uploa d the viewmatrix
217 // using vertex attributes in these cases, but haven't investigated that 214 // using vertex attributes in these cases, but haven't investigated that
218 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi ewMatrix())) { 215 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi ewMatrix())) {
219 return false; 216 return false;
220 } 217 }
221 218
222 if (this->color() != that->color()) { 219 if (this->color() != that->color()) {
223 fBatch.fColor = GrColor_ILLEGAL; 220 fBatch.fColor = GrColor_ILLEGAL;
224 } 221 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 720
724 if (devInside.isEmpty()) { 721 if (devInside.isEmpty()) {
725 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside, 722 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside,
726 devOutside); 723 devOutside);
727 return; 724 return;
728 } 725 }
729 726
730 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu tside, 727 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu tside,
731 devOutsideAssist, devInside, true); 728 devOutsideAssist, devInside, true);
732 } 729 }
OLDNEW
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698