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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); | 581 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
582 | 582 |
583 // Local matrix is ignored if we don't have local coords. If we have lo
calcoords we only | 583 // Local matrix is ignored if we don't have local coords. If we have lo
calcoords we only |
584 // batch with identical view matrices | 584 // batch with identical view matrices |
585 SkMatrix localMatrix; | 585 SkMatrix localMatrix; |
586 if (this->usesLocalCoords() && !this->viewMatrix().invert(&localMatrix))
{ | 586 if (this->usesLocalCoords() && !this->viewMatrix().invert(&localMatrix))
{ |
587 SkDebugf("Cannot invert\n"); | 587 SkDebugf("Cannot invert\n"); |
588 return; | 588 return; |
589 } | 589 } |
590 | 590 |
591 SkAutoTUnref<const GrGeometryProcessor>gp(create_fill_rect_gp(canTweakAl
phaForCoverage, | 591 SkAutoTUnref<const GrGeometryProcessor> gp(create_fill_rect_gp(canTweakA
lphaForCoverage, |
592 localMatri
x)); | 592 localMatr
ix)); |
593 | 593 |
594 batchTarget->initDraw(gp, pipeline); | 594 batchTarget->initDraw(gp, pipeline); |
595 | 595 |
596 // TODO this is hacky, but the only way we have to initialize the GP is
to use the | 596 // TODO this is hacky, but the only way we have to initialize the GP is
to use the |
597 // GrPipelineInfo struct so we can generate the correct shader. Once we
have GrBatch | 597 // GrPipelineInfo struct so we can generate the correct shader. Once we
have GrBatch |
598 // everywhere we can remove this nastiness | 598 // everywhere we can remove this nastiness |
599 GrPipelineInfo init; | 599 GrPipelineInfo init; |
600 init.fColorIgnored = fBatch.fColorIgnored; | 600 init.fColorIgnored = fBatch.fColorIgnored; |
601 init.fOverrideColor = GrColor_ILLEGAL; | 601 init.fOverrideColor = GrColor_ILLEGAL; |
602 init.fCoverageIgnored = fBatch.fCoverageIgnored; | 602 init.fCoverageIgnored = fBatch.fCoverageIgnored; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 | 878 |
879 if (devInside.isEmpty()) { | 879 if (devInside.isEmpty()) { |
880 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside, | 880 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside, |
881 devOutside); | 881 devOutside); |
882 return; | 882 return; |
883 } | 883 } |
884 | 884 |
885 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, | 885 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, |
886 devOutsideAssist, devInside, true); | 886 devOutsideAssist, devInside, true); |
887 } | 887 } |
OLD | NEW |