| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkRasterizer.h" | 10 #include "SkRasterizer.h" |
| 11 #include "SkDraw.h" | 11 #include "SkDraw.h" |
| 12 #include "SkMaskFilter.h" | 12 #include "SkMaskFilter.h" |
| 13 #include "SkPath.h" | 13 #include "SkPath.h" |
| 14 | 14 |
| 15 SK_DEFINE_INST_COUNT(SkRasterizer) | |
| 16 | |
| 17 bool SkRasterizer::rasterize(const SkPath& fillPath, const SkMatrix& matrix, | 15 bool SkRasterizer::rasterize(const SkPath& fillPath, const SkMatrix& matrix, |
| 18 const SkIRect* clipBounds, SkMaskFilter* filter, | 16 const SkIRect* clipBounds, SkMaskFilter* filter, |
| 19 SkMask* mask, SkMask::CreateMode mode) const { | 17 SkMask* mask, SkMask::CreateMode mode) const { |
| 20 SkIRect storage; | 18 SkIRect storage; |
| 21 | 19 |
| 22 if (clipBounds && filter && SkMask::kJustRenderImage_CreateMode != mode) { | 20 if (clipBounds && filter && SkMask::kJustRenderImage_CreateMode != mode) { |
| 23 SkIPoint margin; | 21 SkIPoint margin; |
| 24 SkMask srcM, dstM; | 22 SkMask srcM, dstM; |
| 25 | 23 |
| 26 srcM.fFormat = SkMask::kA8_Format; | 24 srcM.fFormat = SkMask::kA8_Format; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 */ | 39 */ |
| 42 bool SkRasterizer::onRasterize(const SkPath& fillPath, const SkMatrix& matrix, | 40 bool SkRasterizer::onRasterize(const SkPath& fillPath, const SkMatrix& matrix, |
| 43 const SkIRect* clipBounds, | 41 const SkIRect* clipBounds, |
| 44 SkMask* mask, SkMask::CreateMode mode) const { | 42 SkMask* mask, SkMask::CreateMode mode) const { |
| 45 SkPath devPath; | 43 SkPath devPath; |
| 46 | 44 |
| 47 fillPath.transform(matrix, &devPath); | 45 fillPath.transform(matrix, &devPath); |
| 48 return SkDraw::DrawToMask(devPath, clipBounds, NULL, NULL, mask, mode, | 46 return SkDraw::DrawToMask(devPath, clipBounds, NULL, NULL, mask, mode, |
| 49 SkPaint::kFill_Style); | 47 SkPaint::kFill_Style); |
| 50 } | 48 } |
| OLD | NEW |