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 "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 &ppuScale, | 1650 &ppuScale, |
1651 d.fRC->getBounds(), | 1651 d.fRC->getBounds(), |
1652 &clipIRect); | 1652 &clipIRect); |
1653 | 1653 |
1654 //[Fillable-path -> Pixel-path] | 1654 //[Fillable-path -> Pixel-path] |
1655 SkPath* pixelPath = pathIsMutable ? fillablePath : &modifiedPath; | 1655 SkPath* pixelPath = pathIsMutable ? fillablePath : &modifiedPath; |
1656 fillablePath->transform(matrix, pixelPath); | 1656 fillablePath->transform(matrix, pixelPath); |
1657 | 1657 |
1658 SkMask* mask = nullptr; | 1658 SkMask* mask = nullptr; |
1659 | 1659 |
| 1660 SkASSERT(SkPaint::kFill_Style == paint->getStyle() || |
| 1661 (SkPaint::kStroke_Style == paint->getStyle() && 0 == paint->get
StrokeWidth())); |
| 1662 SkStrokeRec::InitStyle style = (SkPaint::kFill_Style == paint->getStyle(
)) |
| 1663 ? SkStrokeRec::kFill_InitStyle |
| 1664 : SkStrokeRec::kHairline_InitStyle; |
1660 //[Pixel-path -> Mask] | 1665 //[Pixel-path -> Mask] |
1661 SkMask rasteredMask; | 1666 SkMask rasteredMask; |
1662 if (SkDraw::DrawToMask( | 1667 if (SkDraw::DrawToMask( |
1663 *pixelPath, | 1668 *pixelPath, |
1664 &clipIRect, | 1669 &clipIRect, |
1665 filter, //just to compute how much to draw. | 1670 filter, //just to compute how much to draw. |
1666 &matrix, | 1671 &matrix, |
1667 &rasteredMask, | 1672 &rasteredMask, |
1668 SkMask::kComputeBoundsAndRenderImage_CreateMode, | 1673 SkMask::kComputeBoundsAndRenderImage_CreateMode, |
1669 paint->getStyle())) { | 1674 style)) { |
1670 | 1675 |
1671 SkAutoMaskFreeImage rasteredAmi(rasteredMask.fImage); | 1676 SkAutoMaskFreeImage rasteredAmi(rasteredMask.fImage); |
1672 mask = &rasteredMask; | 1677 mask = &rasteredMask; |
1673 | 1678 |
1674 //[Mask -> Mask] | 1679 //[Mask -> Mask] |
1675 SkMask filteredMask; | 1680 SkMask filteredMask; |
1676 if (filter->filterMask(&filteredMask, rasteredMask, matrix, nullptr)
) { | 1681 if (filter->filterMask(&filteredMask, rasteredMask, matrix, nullptr)
) { |
1677 mask = &filteredMask; | 1682 mask = &filteredMask; |
1678 } | 1683 } |
1679 SkAutoMaskFreeImage filteredAmi(filteredMask.fImage); | 1684 SkAutoMaskFreeImage filteredAmi(filteredMask.fImage); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2266 //SkXPSDevice* dev = new SkXPSDevice(this); | 2271 //SkXPSDevice* dev = new SkXPSDevice(this); |
2267 //SkSize s = SkSize::Make(width, height); | 2272 //SkSize s = SkSize::Make(width, height); |
2268 //dev->BeginCanvas(s, s, SkMatrix::I()); | 2273 //dev->BeginCanvas(s, s, SkMatrix::I()); |
2269 //return dev; | 2274 //return dev; |
2270 } | 2275 } |
2271 #endif | 2276 #endif |
2272 return new SkXPSDevice(this->fXpsFactory.get()); | 2277 return new SkXPSDevice(this->fXpsFactory.get()); |
2273 } | 2278 } |
2274 | 2279 |
2275 #endif//defined(SK_BUILD_FOR_WIN32) | 2280 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |