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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, | 591 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, |
592 size_t count, const SkPoint pts[], const SkPaint& p
aint) { | 592 size_t count, const SkPoint pts[], const SkPaint& p
aint) { |
593 CHECK_FOR_NODRAW_ANNOTATION(paint); | 593 CHECK_FOR_NODRAW_ANNOTATION(paint); |
594 CHECK_SHOULD_DRAW(draw, false); | 594 CHECK_SHOULD_DRAW(draw, false); |
595 | 595 |
596 SkScalar width = paint.getStrokeWidth(); | 596 SkScalar width = paint.getStrokeWidth(); |
597 if (width < 0) { | 597 if (width < 0) { |
598 return; | 598 return; |
599 } | 599 } |
600 | 600 |
601 // we only handle non-AA hairlines and paints without path effects or mask f
ilters, | 601 // we only handle hairlines and paints without path effects or mask filters, |
602 // else we let the SkDraw call our drawPath() | 602 // else we let the SkDraw call our drawPath() |
603 bool requiresAA = paint.isAntiAlias() && !fRenderTarget->isMultisampled(); | 603 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) { |
604 if (requiresAA || width > 0 || paint.getPathEffect() || paint.getMaskFilter(
)) { | |
605 draw.drawPoints(mode, count, pts, paint, true); | 604 draw.drawPoints(mode, count, pts, paint, true); |
606 return; | 605 return; |
607 } | 606 } |
608 | 607 |
609 GrPaint grPaint; | 608 GrPaint grPaint; |
610 if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) { | 609 if (!skPaint2GrPaintShader(this, paint, true, &grPaint)) { |
611 return; | 610 return; |
612 } | 611 } |
613 | 612 |
614 fContext->drawVertices(grPaint, | 613 fContext->drawVertices(grPaint, |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 GrTexture* texture, | 1784 GrTexture* texture, |
1786 bool needClear) | 1785 bool needClear) |
1787 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { | 1786 : SkDevice(make_bitmap(context, texture->asRenderTarget())) { |
1788 | 1787 |
1789 GrAssert(texture && texture->asRenderTarget()); | 1788 GrAssert(texture && texture->asRenderTarget()); |
1790 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture | 1789 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture |
1791 // cache. We pass true for the third argument so that it will get unlocked. | 1790 // cache. We pass true for the third argument so that it will get unlocked. |
1792 this->initFromRenderTarget(context, texture->asRenderTarget(), true); | 1791 this->initFromRenderTarget(context, texture->asRenderTarget(), true); |
1793 fNeedClear = needClear; | 1792 fNeedClear = needClear; |
1794 } | 1793 } |
OLD | NEW |