| OLD | NEW |
| 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 Loading... |
| 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 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); | 211 if (this->usesLocalCoords() != that->usesLocalCoords()) { |
| 212 return false; |
| 213 } |
| 214 |
| 212 // We apply the viewmatrix to the rect points on the cpu. However, if t
he pipeline uses | 215 // We apply the viewmatrix to the rect points on the cpu. However, if t
he pipeline uses |
| 213 // local coords then we won't be able to batch. We could actually uploa
d the viewmatrix | 216 // local coords then we won't be able to batch. We could actually uploa
d the viewmatrix |
| 214 // using vertex attributes in these cases, but haven't investigated that | 217 // using vertex attributes in these cases, but haven't investigated that |
| 215 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi
ewMatrix())) { | 218 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi
ewMatrix())) { |
| 216 return false; | 219 return false; |
| 217 } | 220 } |
| 218 | 221 |
| 219 if (this->color() != that->color()) { | 222 if (this->color() != that->color()) { |
| 220 fBatch.fColor = GrColor_ILLEGAL; | 223 fBatch.fColor = GrColor_ILLEGAL; |
| 221 } | 224 } |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 | 723 |
| 721 if (devInside.isEmpty()) { | 724 if (devInside.isEmpty()) { |
| 722 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside, | 725 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside, |
| 723 devOutside); | 726 devOutside); |
| 724 return; | 727 return; |
| 725 } | 728 } |
| 726 | 729 |
| 727 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, | 730 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, |
| 728 devOutsideAssist, devInside, true); | 731 devOutsideAssist, devInside, true); |
| 729 } | 732 } |
| OLD | NEW |