| 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 "GrEffect.h" | 10 #include "GrEffect.h" |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 } | 932 } |
| 933 GrDrawState::AutoViewMatrixRestore avmr; | 933 GrDrawState::AutoViewMatrixRestore avmr; |
| 934 if (!avmr.setIdentity(target->drawState())) { | 934 if (!avmr.setIdentity(target->drawState())) { |
| 935 return false; | 935 return false; |
| 936 } | 936 } |
| 937 target->drawState()->addCoverageEffect(effect)->unref(); | 937 target->drawState()->addCoverageEffect(effect)->unref(); |
| 938 SkRect bounds = outer->getBounds(); | 938 SkRect bounds = outer->getBounds(); |
| 939 if (applyAA) { | 939 if (applyAA) { |
| 940 bounds.outset(SK_ScalarHalf, SK_ScalarHalf); | 940 bounds.outset(SK_ScalarHalf, SK_ScalarHalf); |
| 941 } | 941 } |
| 942 target->drawRect(bounds, NULL, NULL, NULL); | 942 target->drawRect(bounds, NULL, NULL); |
| 943 return true; | 943 return true; |
| 944 } | 944 } |
| 945 | 945 |
| 946 bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us
eAA, | 946 bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us
eAA, |
| 947 const SkRRect& rrect, const SkStrokeRec& stroke)
{ | 947 const SkRRect& rrect, const SkStrokeRec& stroke)
{ |
| 948 if (rrect.isOval()) { | 948 if (rrect.isOval()) { |
| 949 return this->drawOval(target, context, useAA, rrect.getBounds(), stroke)
; | 949 return this->drawOval(target, context, useAA, rrect.getBounds(), stroke)
; |
| 950 } | 950 } |
| 951 | 951 |
| 952 bool useCoverageAA = useAA && | 952 bool useCoverageAA = useAA && |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 | 1218 |
| 1219 // drop out the middle quad if we're stroked | 1219 // drop out the middle quad if we're stroked |
| 1220 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : | 1220 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : |
| 1221 SK_ARRAY_COUNT(gRRectIndices); | 1221 SK_ARRAY_COUNT(gRRectIndices); |
| 1222 target->setIndexSourceToBuffer(indexBuffer); | 1222 target->setIndexSourceToBuffer(indexBuffer); |
| 1223 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); | 1223 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); |
| 1224 } | 1224 } |
| 1225 | 1225 |
| 1226 return true; | 1226 return true; |
| 1227 } | 1227 } |
| OLD | NEW |