OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 "SkDraw.h" | 8 #include "SkDraw.h" |
9 #include "SkBlitter.h" | 9 #include "SkBlitter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 | 810 |
811 // transform rect into devRect | 811 // transform rect into devRect |
812 matrix.mapPoints(rect_points(devRect), rect_points(rect), 2); | 812 matrix.mapPoints(rect_points(devRect), rect_points(rect), 2); |
813 devRect.sort(); | 813 devRect.sort(); |
814 | 814 |
815 // look for the quick exit, before we build a blitter | 815 // look for the quick exit, before we build a blitter |
816 SkIRect ir; | 816 SkIRect ir; |
817 devRect.roundOut(&ir); | 817 devRect.roundOut(&ir); |
818 if (paint.getStyle() != SkPaint::kFill_Style) { | 818 if (paint.getStyle() != SkPaint::kFill_Style) { |
819 // extra space for hairlines | 819 // extra space for hairlines |
820 ir.inset(-1, -1); | 820 if (paint.getStrokeWidth() == 0) { |
821 ir.outset(1, 1); | |
822 } else { | |
823 ir.outset(paint.getStrokeWidth(), paint.getStrokeWidth()); | |
reed1
2014/09/09 13:05:49
stroke_width / 2 ?
| |
824 } | |
821 } | 825 } |
822 if (fRC->quickReject(ir)) { | 826 if (fRC->quickReject(ir)) { |
823 return; | 827 return; |
824 } | 828 } |
825 | 829 |
826 SkDeviceLooper looper(*fBitmap, *fRC, ir, paint.isAntiAlias()); | 830 SkDeviceLooper looper(*fBitmap, *fRC, ir, paint.isAntiAlias()); |
827 while (looper.next()) { | 831 while (looper.next()) { |
828 SkRect localDevRect; | 832 SkRect localDevRect; |
829 looper.mapRect(&localDevRect, devRect); | 833 looper.mapRect(&localDevRect, devRect); |
830 SkMatrix localMatrix; | 834 SkMatrix localMatrix; |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2373 mask->fImage = SkMask::AllocImage(size); | 2377 mask->fImage = SkMask::AllocImage(size); |
2374 memset(mask->fImage, 0, mask->computeImageSize()); | 2378 memset(mask->fImage, 0, mask->computeImageSize()); |
2375 } | 2379 } |
2376 | 2380 |
2377 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2381 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2378 draw_into_mask(*mask, devPath, style); | 2382 draw_into_mask(*mask, devPath, style); |
2379 } | 2383 } |
2380 | 2384 |
2381 return true; | 2385 return true; |
2382 } | 2386 } |
OLD | NEW |