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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 279 |
280 GrEffectRef* EllipseEdgeEffect::TestCreate(SkMWCRandom* random, | 280 GrEffectRef* EllipseEdgeEffect::TestCreate(SkMWCRandom* random, |
281 GrContext* context, | 281 GrContext* context, |
282 const GrDrawTargetCaps&, | 282 const GrDrawTargetCaps&, |
283 GrTexture* textures[]) { | 283 GrTexture* textures[]) { |
284 return EllipseEdgeEffect::Create(random->nextBool()); | 284 return EllipseEdgeEffect::Create(random->nextBool()); |
285 } | 285 } |
286 | 286 |
287 /////////////////////////////////////////////////////////////////////////////// | 287 /////////////////////////////////////////////////////////////////////////////// |
288 | 288 |
| 289 void GrOvalRenderer::reset() { |
| 290 GrSafeSetNull(fRRectIndexBuffer); |
| 291 } |
| 292 |
289 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo
ol useAA, | 293 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo
ol useAA, |
290 const GrRect& oval, const SkStrokeRec& stroke) | 294 const GrRect& oval, const SkStrokeRec& stroke) |
291 { | 295 { |
292 if (!useAA) { | 296 if (!useAA) { |
293 return false; | 297 return false; |
294 } | 298 } |
295 | 299 |
296 const SkMatrix& vm = context->getMatrix(); | 300 const SkMatrix& vm = context->getMatrix(); |
297 | 301 |
298 // we can draw circles | 302 // we can draw circles |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 } | 850 } |
847 | 851 |
848 // drop out the middle quad if we're stroked | 852 // drop out the middle quad if we're stroked |
849 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); | 853 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); |
850 target->setIndexSourceToBuffer(indexBuffer); | 854 target->setIndexSourceToBuffer(indexBuffer); |
851 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); | 855 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); |
852 } | 856 } |
853 | 857 |
854 return true; | 858 return true; |
855 } | 859 } |
OLD | NEW |