| 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 "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 const SkPaint& paint, const SkMatrix* prePathMatrix, | 750 const SkPaint& paint, const SkMatrix* prePathMatrix, |
| 751 bool pathIsMutable) { | 751 bool pathIsMutable) { |
| 752 ASSERT_SINGLE_OWNER | 752 ASSERT_SINGLE_OWNER |
| 753 if (!origSrcPath.isInverseFillType() && !paint.getPathEffect() && !prePathMa
trix) { | 753 if (!origSrcPath.isInverseFillType() && !paint.getPathEffect() && !prePathMa
trix) { |
| 754 SkPoint points[2]; | 754 SkPoint points[2]; |
| 755 if (SkPaint::kStroke_Style == paint.getStyle() && paint.getStrokeWidth()
> 0 && | 755 if (SkPaint::kStroke_Style == paint.getStyle() && paint.getStrokeWidth()
> 0 && |
| 756 !paint.getMaskFilter() && SkPaint::kRound_Cap != paint.getStrokeCap(
) && | 756 !paint.getMaskFilter() && SkPaint::kRound_Cap != paint.getStrokeCap(
) && |
| 757 draw.fMatrix->preservesRightAngles() && origSrcPath.isLine(points))
{ | 757 draw.fMatrix->preservesRightAngles() && origSrcPath.isLine(points))
{ |
| 758 // Path-based stroking looks better for thin rects | 758 // Path-based stroking looks better for thin rects |
| 759 SkScalar strokeWidth = draw.fMatrix->getMaxScale() * paint.getStroke
Width(); | 759 SkScalar strokeWidth = draw.fMatrix->getMaxScale() * paint.getStroke
Width(); |
| 760 if (strokeWidth > 0.9f) { | 760 if (strokeWidth >= 1.0f) { |
| 761 // Round capping support is currently disabled b.c. it would req
uire | 761 // Round capping support is currently disabled b.c. it would req
uire |
| 762 // a RRect batch that takes a localMatrix. | 762 // a RRect batch that takes a localMatrix. |
| 763 this->drawStrokedLine(points, draw, paint); | 763 this->drawStrokedLine(points, draw, paint); |
| 764 return; | 764 return; |
| 765 } | 765 } |
| 766 } | 766 } |
| 767 bool isClosed; | 767 bool isClosed; |
| 768 SkRect rect; | 768 SkRect rect; |
| 769 if (origSrcPath.isRect(&rect, &isClosed) && isClosed) { | 769 if (origSrcPath.isRect(&rect, &isClosed) && isClosed) { |
| 770 this->drawRect(draw, rect, paint); | 770 this->drawRect(draw, rect, paint); |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 } | 1923 } |
| 1924 | 1924 |
| 1925 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1925 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
| 1926 ASSERT_SINGLE_OWNER | 1926 ASSERT_SINGLE_OWNER |
| 1927 // We always return a transient cache, so it is freed after each | 1927 // We always return a transient cache, so it is freed after each |
| 1928 // filter traversal. | 1928 // filter traversal. |
| 1929 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); | 1929 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); |
| 1930 } | 1930 } |
| 1931 | 1931 |
| 1932 #endif | 1932 #endif |
| OLD | NEW |