| 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 } | 888 } |
| 889 | 889 |
| 890 void GrAARectRenderer::fillAANestedRects(GrDrawTarget* target, | 890 void GrAARectRenderer::fillAANestedRects(GrDrawTarget* target, |
| 891 GrPipelineBuilder* pipelineBuilder, | 891 GrPipelineBuilder* pipelineBuilder, |
| 892 GrColor color, | 892 GrColor color, |
| 893 const SkMatrix& viewMatrix, | 893 const SkMatrix& viewMatrix, |
| 894 const SkRect rects[2]) { | 894 const SkRect rects[2]) { |
| 895 SkASSERT(viewMatrix.rectStaysRect()); | 895 SkASSERT(viewMatrix.rectStaysRect()); |
| 896 SkASSERT(!rects[1].isEmpty()); | 896 SkASSERT(!rects[1].isEmpty()); |
| 897 | 897 |
| 898 SkRect devOutside, devOutsideAssist, devInside; | 898 SkRect devOutside, devInside; |
| 899 viewMatrix.mapRect(&devOutside, rects[0]); | 899 viewMatrix.mapRect(&devOutside, rects[0]); |
| 900 // can't call mapRect for devInside since it calls sort | 900 // can't call mapRect for devInside since it calls sort |
| 901 viewMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2); | 901 viewMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2); |
| 902 | 902 |
| 903 if (devInside.isEmpty()) { | 903 if (devInside.isEmpty()) { |
| 904 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside,
devOutside); | 904 this->fillAARect(target, pipelineBuilder, color, viewMatrix, devOutside,
devOutside); |
| 905 return; | 905 return; |
| 906 } | 906 } |
| 907 | 907 |
| 908 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, | 908 this->geometryStrokeAARect(target, pipelineBuilder, color, viewMatrix, devOu
tside, |
| 909 devOutsideAssist, devInside, true); | 909 devOutside, devInside, true); |
| 910 } | 910 } |
| 911 | 911 |
| 912 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 912 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 913 | 913 |
| 914 #ifdef GR_TEST_UTILS | 914 #ifdef GR_TEST_UTILS |
| 915 | 915 |
| 916 BATCH_TEST_DEFINE(AAFillRectBatch) { | 916 BATCH_TEST_DEFINE(AAFillRectBatch) { |
| 917 AAFillRectBatch::Geometry geo; | 917 AAFillRectBatch::Geometry geo; |
| 918 geo.fColor = GrRandomColor(random); | 918 geo.fColor = GrRandomColor(random); |
| 919 geo.fViewMatrix = GrTest::TestMatrix(random); | 919 geo.fViewMatrix = GrTest::TestMatrix(random); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 geo.fColor = GrRandomColor(random); | 956 geo.fColor = GrRandomColor(random); |
| 957 geo.fDevOutside = outside; | 957 geo.fDevOutside = outside; |
| 958 geo.fDevOutsideAssist = outsideAssist; | 958 geo.fDevOutsideAssist = outsideAssist; |
| 959 geo.fDevInside = inside; | 959 geo.fDevInside = inside; |
| 960 geo.fMiterStroke = miterStroke; | 960 geo.fMiterStroke = miterStroke; |
| 961 | 961 |
| 962 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random), indexBuffe
r); | 962 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random), indexBuffe
r); |
| 963 } | 963 } |
| 964 | 964 |
| 965 #endif | 965 #endif |
| OLD | NEW |