OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrAARectRenderer.h" | 9 #include "GrAARectRenderer.h" |
10 #include "GrAtlasTextContext.h" | 10 #include "GrAtlasTextContext.h" |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 } | 886 } |
887 | 887 |
888 AutoCheckFlush acf(fContext); | 888 AutoCheckFlush acf(fContext); |
889 if (!this->prepareToDraw(rt)) { | 889 if (!this->prepareToDraw(rt)) { |
890 return; | 890 return; |
891 } | 891 } |
892 | 892 |
893 GrPipelineBuilder pipelineBuilder(paint, rt, clip); | 893 GrPipelineBuilder pipelineBuilder(paint, rt, clip); |
894 GrColor color = paint.getColor(); | 894 GrColor color = paint.getColor(); |
895 if (!GrOvalRenderer::DrawRRect(fDrawTarget, | 895 if (!GrOvalRenderer::DrawRRect(fDrawTarget, |
896 &pipelineBuilder, | 896 pipelineBuilder, |
897 color, | 897 color, |
898 viewMatrix, | 898 viewMatrix, |
899 paint.isAntiAlias(), | 899 paint.isAntiAlias(), |
900 rrect, | 900 rrect, |
901 strokeInfo)) { | 901 strokeInfo)) { |
902 SkPath path; | 902 SkPath path; |
903 path.setIsVolatile(true); | 903 path.setIsVolatile(true); |
904 path.addRRect(rrect); | 904 path.addRRect(rrect); |
905 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, | 905 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, |
906 paint.isAntiAlias(), path, strokeInfo); | 906 paint.isAntiAlias(), path, strokeInfo); |
(...skipping 14 matching lines...) Expand all Loading... |
921 } | 921 } |
922 | 922 |
923 AutoCheckFlush acf(fContext); | 923 AutoCheckFlush acf(fContext); |
924 if (!this->prepareToDraw(rt)) { | 924 if (!this->prepareToDraw(rt)) { |
925 return; | 925 return; |
926 } | 926 } |
927 | 927 |
928 GrPipelineBuilder pipelineBuilder(paint, rt, clip); | 928 GrPipelineBuilder pipelineBuilder(paint, rt, clip); |
929 GrColor color = paint.getColor(); | 929 GrColor color = paint.getColor(); |
930 if (!GrOvalRenderer::DrawDRRect(fDrawTarget, | 930 if (!GrOvalRenderer::DrawDRRect(fDrawTarget, |
931 &pipelineBuilder, | 931 pipelineBuilder, |
932 color, | 932 color, |
933 viewMatrix, | 933 viewMatrix, |
934 paint.isAntiAlias(), | 934 paint.isAntiAlias(), |
935 outer, | 935 outer, |
936 inner)) { | 936 inner)) { |
937 SkPath path; | 937 SkPath path; |
938 path.setIsVolatile(true); | 938 path.setIsVolatile(true); |
939 path.addRRect(inner); | 939 path.addRRect(inner); |
940 path.addRRect(outer); | 940 path.addRRect(outer); |
941 path.setFillType(SkPath::kEvenOdd_FillType); | 941 path.setFillType(SkPath::kEvenOdd_FillType); |
(...skipping 26 matching lines...) Expand all Loading... |
968 } | 968 } |
969 | 969 |
970 AutoCheckFlush acf(fContext); | 970 AutoCheckFlush acf(fContext); |
971 if (!this->prepareToDraw(rt)) { | 971 if (!this->prepareToDraw(rt)) { |
972 return; | 972 return; |
973 } | 973 } |
974 | 974 |
975 GrPipelineBuilder pipelineBuilder(paint, rt, clip); | 975 GrPipelineBuilder pipelineBuilder(paint, rt, clip); |
976 GrColor color = paint.getColor(); | 976 GrColor color = paint.getColor(); |
977 if (!GrOvalRenderer::DrawOval(fDrawTarget, | 977 if (!GrOvalRenderer::DrawOval(fDrawTarget, |
978 &pipelineBuilder, | 978 pipelineBuilder, |
979 color, | 979 color, |
980 viewMatrix, | 980 viewMatrix, |
981 paint.isAntiAlias(), | 981 paint.isAntiAlias(), |
982 oval, | 982 oval, |
983 strokeInfo)) { | 983 strokeInfo)) { |
984 SkPath path; | 984 SkPath path; |
985 path.setIsVolatile(true); | 985 path.setIsVolatile(true); |
986 path.addOval(oval); | 986 path.addOval(oval); |
987 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, | 987 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, |
988 paint.isAntiAlias(), path, strokeInfo); | 988 paint.isAntiAlias(), path, strokeInfo); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 GrAARectRenderer::FillAANestedRects(fDrawTarget, pipelineBuilder
, color, | 1078 GrAARectRenderer::FillAANestedRects(fDrawTarget, pipelineBuilder
, color, |
1079 viewMatrix, rects); | 1079 viewMatrix, rects); |
1080 return; | 1080 return; |
1081 } | 1081 } |
1082 } | 1082 } |
1083 SkRect ovalRect; | 1083 SkRect ovalRect; |
1084 bool isOval = path.isOval(&ovalRect); | 1084 bool isOval = path.isOval(&ovalRect); |
1085 | 1085 |
1086 if (isOval && !path.isInverseFillType()) { | 1086 if (isOval && !path.isInverseFillType()) { |
1087 if (GrOvalRenderer::DrawOval(fDrawTarget, | 1087 if (GrOvalRenderer::DrawOval(fDrawTarget, |
1088 &pipelineBuilder, | 1088 pipelineBuilder, |
1089 color, | 1089 color, |
1090 viewMatrix, | 1090 viewMatrix, |
1091 paint.isAntiAlias(), | 1091 paint.isAntiAlias(), |
1092 ovalRect, | 1092 ovalRect, |
1093 strokeInfo)) { | 1093 strokeInfo)) { |
1094 return; | 1094 return; |
1095 } | 1095 } |
1096 } | 1096 } |
1097 } | 1097 } |
1098 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, pai
nt.isAntiAlias(), | 1098 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, pai
nt.isAntiAlias(), |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 return DrawVerticesBatch::Create(geometry, type, viewMatrix, | 1311 return DrawVerticesBatch::Create(geometry, type, viewMatrix, |
1312 positions.begin(), vertexCount, | 1312 positions.begin(), vertexCount, |
1313 indices.begin(), hasIndices ? vertexCount :
0, | 1313 indices.begin(), hasIndices ? vertexCount :
0, |
1314 colors.begin(), | 1314 colors.begin(), |
1315 texCoords.begin(), | 1315 texCoords.begin(), |
1316 bounds); | 1316 bounds); |
1317 } | 1317 } |
1318 | 1318 |
1319 #endif | 1319 #endif |
1320 | 1320 |
OLD | NEW |