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 "SkPaint.h" | 8 #include "SkPaint.h" |
9 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
10 #include "SkAutoKern.h" | 10 #include "SkAutoKern.h" |
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1996 return effect; | 1996 return effect; |
1997 } | 1997 } |
1998 | 1998 |
1999 SkMaskFilter* SkPaint::setMaskFilter(SkMaskFilter* filter) { | 1999 SkMaskFilter* SkPaint::setMaskFilter(SkMaskFilter* filter) { |
2000 SkRefCnt_SafeAssign(fMaskFilter, filter); | 2000 SkRefCnt_SafeAssign(fMaskFilter, filter); |
2001 return filter; | 2001 return filter; |
2002 } | 2002 } |
2003 | 2003 |
2004 /////////////////////////////////////////////////////////////////////////////// | 2004 /////////////////////////////////////////////////////////////////////////////// |
2005 | 2005 |
2006 bool SkPaint::getFillPath(const SkPath& src, SkPath* dst, | 2006 bool SkPaint::getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect
, |
2007 const SkRect* cullRect) const { | 2007 SkScalar resScale) const { |
2008 SkStrokeRec rec(*this); | 2008 SkStrokeRec rec(*this, resScale); |
2009 | 2009 |
2010 const SkPath* srcPtr = &src; | 2010 const SkPath* srcPtr = &src; |
2011 SkPath tmpPath; | 2011 SkPath tmpPath; |
2012 | 2012 |
2013 if (fPathEffect && fPathEffect->filterPath(&tmpPath, src, &rec, cullRect)) { | 2013 if (fPathEffect && fPathEffect->filterPath(&tmpPath, src, &rec, cullRect)) { |
2014 srcPtr = &tmpPath; | 2014 srcPtr = &tmpPath; |
2015 } | 2015 } |
2016 | 2016 |
2017 if (!rec.applyToPath(dst, *srcPtr)) { | 2017 if (!rec.applyToPath(dst, *srcPtr)) { |
2018 if (srcPtr == &tmpPath) { | 2018 if (srcPtr == &tmpPath) { |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2384 } | 2384 } |
2385 | 2385 |
2386 uint32_t SkPaint::getHash() const { | 2386 uint32_t SkPaint::getHash() const { |
2387 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, | 2387 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, |
2388 // so fBitfields should be 10 pointers and 6 32-bit values from the start. | 2388 // so fBitfields should be 10 pointers and 6 32-bit values from the start. |
2389 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 *
sizeof(uint32_t), | 2389 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 *
sizeof(uint32_t), |
2390 SkPaint_notPackedTightly); | 2390 SkPaint_notPackedTightly); |
2391 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), | 2391 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), |
2392 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); | 2392 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); |
2393 } | 2393 } |
OLD | NEW |