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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 SkAutoTUnref<GrBatch> batch(AAStrokeRectBatch::Create(geometry, viewMatrix))
; | 801 SkAutoTUnref<GrBatch> batch(AAStrokeRectBatch::Create(geometry, viewMatrix))
; |
802 target->drawBatch(pipelineBuilder, batch); | 802 target->drawBatch(pipelineBuilder, batch); |
803 } | 803 } |
804 | 804 |
805 void GrAARectRenderer::fillAANestedRects(GrDrawTarget* target, | 805 void GrAARectRenderer::fillAANestedRects(GrDrawTarget* target, |
806 GrPipelineBuilder* pipelineBuilder, | 806 GrPipelineBuilder* pipelineBuilder, |
807 GrColor color, | 807 GrColor color, |
808 const SkMatrix& viewMatrix, | 808 const SkMatrix& viewMatrix, |
809 const SkRect rects[2]) { | 809 const SkRect rects[2]) { |
810 SkASSERT(viewMatrix.rectStaysRect()); | 810 SkASSERT(viewMatrix.rectStaysRect()); |
811 SkASSERT(!rects[1].isEmpty()); | 811 SkASSERT(!rects[0].isEmpty() && !rects[1].isEmpty()); |
812 | 812 |
813 SkRect devOutside, devInside; | 813 SkRect devOutside, devInside; |
814 viewMatrix.mapRect(&devOutside, rects[0]); | 814 viewMatrix.mapRect(&devOutside, rects[0]); |
815 // can't call mapRect for devInside since it calls sort | 815 viewMatrix.mapRect(&devInside, rects[1]); |
816 viewMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2); | |
817 | 816 |
818 if (devInside.isEmpty()) { | 817 if (devInside.isEmpty()) { |
819 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside,
devOutside); | 818 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside,
devOutside); |
820 return; | 819 return; |
821 } | 820 } |
822 | 821 |
823 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, | 822 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, |
824 devOutside, devInside, true); | 823 devOutside, devInside, true); |
825 } | 824 } |
826 | 825 |
(...skipping 26 matching lines...) Expand all Loading... |
853 geo.fColor = GrRandomColor(random); | 852 geo.fColor = GrRandomColor(random); |
854 geo.fDevOutside = outside; | 853 geo.fDevOutside = outside; |
855 geo.fDevOutsideAssist = outsideAssist; | 854 geo.fDevOutsideAssist = outsideAssist; |
856 geo.fDevInside = inside; | 855 geo.fDevInside = inside; |
857 geo.fMiterStroke = miterStroke; | 856 geo.fMiterStroke = miterStroke; |
858 | 857 |
859 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random)); | 858 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random)); |
860 } | 859 } |
861 | 860 |
862 #endif | 861 #endif |
OLD | NEW |