Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: src/core/SkPaint.cpp

Issue 770703002: Bump min picture version. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkLocalMatrixShader.cpp ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
- }
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/core/SkLocalMatrixShader.cpp ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698