OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
9 | 9 |
10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 } | 1383 } |
1384 | 1384 |
1385 bool GrOvalRenderer::DrawDRRect(GrDrawTarget* target, | 1385 bool GrOvalRenderer::DrawDRRect(GrDrawTarget* target, |
1386 const GrPipelineBuilder& pipelineBuilder, | 1386 const GrPipelineBuilder& pipelineBuilder, |
1387 GrColor color, | 1387 GrColor color, |
1388 const SkMatrix& viewMatrix, | 1388 const SkMatrix& viewMatrix, |
1389 bool useAA, | 1389 bool useAA, |
1390 const SkRRect& origOuter, | 1390 const SkRRect& origOuter, |
1391 const SkRRect& origInner) { | 1391 const SkRRect& origInner) { |
1392 bool applyAA = useAA && !pipelineBuilder.getRenderTarget()->isUnifiedMultisa
mpled(); | 1392 bool applyAA = useAA && !pipelineBuilder.getRenderTarget()->isUnifiedMultisa
mpled(); |
1393 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; | 1393 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfp; |
1394 if (!origInner.isEmpty()) { | 1394 if (!origInner.isEmpty()) { |
1395 SkTCopyOnFirstWrite<SkRRect> inner(origInner); | 1395 SkTCopyOnFirstWrite<SkRRect> inner(origInner); |
1396 if (!viewMatrix.isIdentity()) { | 1396 if (!viewMatrix.isIdentity()) { |
1397 if (!origInner.transform(viewMatrix, inner.writable())) { | 1397 if (!origInner.transform(viewMatrix, inner.writable())) { |
1398 return false; | 1398 return false; |
1399 } | 1399 } |
1400 } | 1400 } |
1401 GrPrimitiveEdgeType edgeType = applyAA ? | 1401 GrPrimitiveEdgeType edgeType = applyAA ? |
1402 kInverseFillAA_GrProcessorEdgeType : | 1402 kInverseFillAA_GrProcessorEdgeType : |
1403 kInverseFillBW_GrProcessorEdgeType; | 1403 kInverseFillBW_GrProcessorEdgeType; |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2012 } | 2012 } |
2013 | 2013 |
2014 BATCH_TEST_DEFINE(RRectBatch) { | 2014 BATCH_TEST_DEFINE(RRectBatch) { |
2015 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); | 2015 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); |
2016 GrColor color = GrRandomColor(random); | 2016 GrColor color = GrRandomColor(random); |
2017 const SkRRect& rrect = GrTest::TestRRectSimple(random); | 2017 const SkRRect& rrect = GrTest::TestRRectSimple(random); |
2018 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); | 2018 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); |
2019 } | 2019 } |
2020 | 2020 |
2021 #endif | 2021 #endif |
OLD | NEW |