OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "effects/GrTextureDomainEffect.h" | 10 #include "effects/GrTextureDomainEffect.h" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, | 598 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, |
599 size_t count, const SkPoint pts[], const SkPaint& p
aint) { | 599 size_t count, const SkPoint pts[], const SkPaint& p
aint) { |
600 CHECK_FOR_NODRAW_ANNOTATION(paint); | 600 CHECK_FOR_NODRAW_ANNOTATION(paint); |
601 CHECK_SHOULD_DRAW(draw, false); | 601 CHECK_SHOULD_DRAW(draw, false); |
602 | 602 |
603 SkScalar width = paint.getStrokeWidth(); | 603 SkScalar width = paint.getStrokeWidth(); |
604 if (width < 0) { | 604 if (width < 0) { |
605 return; | 605 return; |
606 } | 606 } |
607 | 607 |
608 // we only handle hairlines and paints without path effects or mask filters, | 608 // we only handle non-AA hairlines and paints without path effects or mask f
ilters, |
609 // else we let the SkDraw call our drawPath() | 609 // else we let the SkDraw call our drawPath() |
610 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) { | 610 bool requiresAA = paint.isAntiAlias() && !fRenderTarget->isMultisampled(); |
| 611 if (requiresAA || width > 0 || paint.getPathEffect() || paint.getMaskFilter(
)) { |
611 draw.drawPoints(mode, count, pts, paint, true); | 612 draw.drawPoints(mode, count, pts, paint, true); |
612 return; | 613 return; |
613 } | 614 } |
614 | 615 |
615 GrPaint grPaint; | 616 GrPaint grPaint; |
616 if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) { | 617 if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) { |
617 return; | 618 return; |
618 } | 619 } |
619 | 620 |
620 fContext->drawVertices(grPaint, | 621 fContext->drawVertices(grPaint, |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1834 GrTexture* texture, | 1835 GrTexture* texture, |
1835 bool needClear) | 1836 bool needClear) |
1836 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { | 1837 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { |
1837 | 1838 |
1838 GrAssert(texture && texture->asRenderTarget()); | 1839 GrAssert(texture && texture->asRenderTarget()); |
1839 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture | 1840 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture |
1840 // cache. We pass true for the third argument so that it will get unlocked. | 1841 // cache. We pass true for the third argument so that it will get unlocked. |
1841 this->initFromRenderTarget(context, texture->asRenderTarget(), true); | 1842 this->initFromRenderTarget(context, texture->asRenderTarget(), true); |
1842 fNeedClear = needClear; | 1843 fNeedClear = needClear; |
1843 } | 1844 } |
OLD | NEW |