Index: src/core/SkPaint.cpp |
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp |
index d81784ace4bff46a5b70e07e4a5cf1e22b61be11..162988beeb145a50e6a3616383a46a6b67d8cfdf 100644 |
--- a/src/core/SkPaint.cpp |
+++ b/src/core/SkPaint.cpp |
@@ -1799,11 +1799,10 @@ static uint32_t pack_4(unsigned a, unsigned b, unsigned c, unsigned d) { |
#endif |
enum FlatFlags { |
- kHasTypeface_FlatFlag = 0x01, |
- kHasEffects_FlatFlag = 0x02, |
- kHasNonDefaultPaintOptionsAndroid_FlatFlag = 0x04, |
+ kHasTypeface_FlatFlag = 0x1, |
+ kHasEffects_FlatFlag = 0x2, |
- kFlatFlagMask = 0x7, |
+ kFlatFlagMask = 0x3, |
}; |
enum BitsPerField { |
@@ -1839,37 +1838,6 @@ static FlatFlags unpack_paint_flags(SkPaint* paint, uint32_t packed) { |
return (FlatFlags)(packed & kFlatFlagMask); |
} |
-// V22_COMPATIBILITY_CODE |
-static FlatFlags unpack_paint_flags_v22(SkPaint* paint, uint32_t packed) { |
- enum { |
- kFilterBitmap_Flag = 0x02, |
- kHighQualityFilterBitmap_Flag = 0x4000, |
- |
- kAll_Flags = kFilterBitmap_Flag | kHighQualityFilterBitmap_Flag |
- }; |
- |
- // previously flags:16, textAlign:8, flatFlags:8 |
- // now flags:16, hinting:4, textAlign:4, flatFlags:8 |
- unsigned flags = packed >> 16; |
- int filter = 0; |
- if (flags & kFilterBitmap_Flag) { |
- filter |= 1; |
- } |
- if (flags & kHighQualityFilterBitmap_Flag) { |
- filter |= 2; |
- } |
- paint->setFilterLevel((SkPaint::FilterLevel)filter); |
- flags &= ~kAll_Flags; // remove these (now dead) bit flags |
- |
- paint->setFlags(flags); |
- |
- // hinting added later. 0 in this nibble means use the default. |
- uint32_t hinting = (packed >> 12) & 0xF; |
- paint->setHinting(0 == hinting ? SkPaint::kNormal_Hinting : static_cast<SkPaint::Hinting>(hinting-1)); |
- paint->setTextAlign(static_cast<SkPaint::Align>((packed >> 8) & 0xF)); |
- return (FlatFlags)(packed & kFlatFlagMask); |
-} |
- |
// The size of a flat paint's POD fields |
static const uint32_t kPODPaintSize = 5 * sizeof(SkScalar) + |
1 * sizeof(SkColor) + |
@@ -1948,12 +1916,7 @@ void SkPaint::unflatten(SkReadBuffer& buffer) { |
this->setStrokeMiter(read_scalar(pod)); |
this->setColor(*pod++); |
- unsigned flatFlags = 0; |
- if (buffer.isVersionLT(SkReadBuffer::kFilterLevelIsEnum_Version)) { |
- flatFlags = unpack_paint_flags_v22(this, *pod++); |
- } else { |
- flatFlags = unpack_paint_flags(this, *pod++); |
- } |
+ unsigned flatFlags = unpack_paint_flags(this, *pod++); |
uint32_t tmp = *pod++; |
this->setStrokeCap(static_cast<Cap>((tmp >> 24) & 0xFF)); |
@@ -1990,14 +1953,6 @@ void SkPaint::unflatten(SkReadBuffer& buffer) { |
this->setLooper(NULL); |
this->setImageFilter(NULL); |
} |
- |
- if (buffer.isVersionLT(SkReadBuffer::kRemoveAndroidPaintOpts_Version) && |
- flatFlags & kHasNonDefaultPaintOptionsAndroid_FlatFlag) { |
- SkString tag; |
- buffer.readUInt(); |
- buffer.readString(&tag); |
- buffer.readBool(); |
- } |
} |
/////////////////////////////////////////////////////////////////////////////// |