diff options
author | 2014-08-14 06:29:02 -0700 | |
---|---|---|
committer | 2014-08-14 06:29:03 -0700 | |
commit | 3b6255493e458c6b2c1412af908581f0bf3f6b70 (patch) | |
tree | a58d075a0e1fb6a5870460ff79c5be2239e5d7f6 /include | |
parent | 30e26cdb411ef55f7ce3d53015546250443f27f8 (diff) |
Remove SkPaintOptionsAndroid
Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b
R=reed@google.com, mtklein@google.com, tomhudson@google.com
Author: djsollen@google.com
Review URL: https://codereview.chromium.org/447873003
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPaint.h | 10 | ||||
-rw-r--r-- | include/core/SkPaintOptionsAndroid.h | 120 | ||||
-rw-r--r-- | include/core/SkPicture.h | 3 | ||||
-rw-r--r-- | include/core/SkReadBuffer.h | 1 |
4 files changed, 3 insertions, 131 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index 58cb160ada..1814cae29d 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -15,9 +15,6 @@ #include "SkDrawLooper.h" #include "SkMatrix.h" #include "SkXfermode.h" -#ifdef SK_BUILD_FOR_ANDROID -#include "SkPaintOptionsAndroid.h" -#endif class SkAnnotation; class SkAutoGlyphCache; @@ -941,11 +938,6 @@ public: #ifdef SK_BUILD_FOR_ANDROID uint32_t getGenerationID() const; void setGenerationID(uint32_t generationID); - - const SkPaintOptionsAndroid& getPaintOptionsAndroid() const { - return fPaintOptionsAndroid; - } - void setPaintOptionsAndroid(const SkPaintOptionsAndroid& options); #endif // returns true if the paint's settings (e.g. xfermode + alpha) resolve to @@ -1138,8 +1130,6 @@ private: friend class SkCanonicalizePaint; #ifdef SK_BUILD_FOR_ANDROID - SkPaintOptionsAndroid fPaintOptionsAndroid; - // In order for the == operator to work properly this must be the last field // in the struct so that we can do a memcmp to this field's offset. uint32_t fGenerationID; diff --git a/include/core/SkPaintOptionsAndroid.h b/include/core/SkPaintOptionsAndroid.h deleted file mode 100644 index 4d0bae3eb8..0000000000 --- a/include/core/SkPaintOptionsAndroid.h +++ /dev/null @@ -1,120 +0,0 @@ - -/* - * Copyright 2012 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkPaintOptionsAndroid_DEFINED -#define SkPaintOptionsAndroid_DEFINED - -#include "SkTypes.h" -#include "SkString.h" - -class SkReadBuffer; -class SkWriteBuffer; - -/** \class SkLanguage - - The SkLanguage class represents a human written language, and is used by - text draw operations to determine which glyph to draw when drawing - characters with variants (ie Han-derived characters). -*/ -class SkLanguage { -public: - SkLanguage() { } - SkLanguage(const SkString& tag) : fTag(tag) { } - SkLanguage(const char* tag) : fTag(tag) { } - SkLanguage(const char* tag, size_t len) : fTag(tag, len) { } - SkLanguage(const SkLanguage& b) : fTag(b.fTag) { } - - /** Gets a BCP 47 language identifier for this SkLanguage. - @return a BCP 47 language identifier representing this language - */ - const SkString& getTag() const { return fTag; } - - /** Performs BCP 47 fallback to return an SkLanguage one step more general. - @return an SkLanguage one step more general - */ - SkLanguage getParent() const; - - bool operator==(const SkLanguage& b) const { - return fTag == b.fTag; - } - bool operator!=(const SkLanguage& b) const { - return fTag != b.fTag; - } - SkLanguage& operator=(const SkLanguage& b) { - fTag = b.fTag; - return *this; - } - -private: - //! BCP 47 language identifier - SkString fTag; -}; - -class SkPaintOptionsAndroid { -public: - SkPaintOptionsAndroid() { - fFontVariant = kDefault_Variant; - } - - SkPaintOptionsAndroid& operator=(const SkPaintOptionsAndroid& b) { - fLanguage = b.fLanguage; - fFontVariant = b.fFontVariant; - return *this; - } - - bool operator==(const SkPaintOptionsAndroid& b) const { - return !(*this != b); - } - - bool operator!=(const SkPaintOptionsAndroid& b) const { - return fLanguage != b.fLanguage || - fFontVariant != b.fFontVariant; - } - - void flatten(SkWriteBuffer&) const; - void unflatten(SkReadBuffer&); - - /** Return the paint's language value used for drawing text. - @return the paint's language value used for drawing text. - */ - const SkLanguage& getLanguage() const { return fLanguage; } - - /** Set the paint's language value used for drawing text. - @param language set the paint's language value for drawing text. - */ - void setLanguage(const SkLanguage& language) { fLanguage = language; } - void setLanguage(const char* languageTag) { fLanguage = SkLanguage(languageTag); } - - - enum FontVariant { - kDefault_Variant = 0x01, - kCompact_Variant = 0x02, - kElegant_Variant = 0x04, - kLast_Variant = kElegant_Variant, - }; - - /** Return the font variant - @return the font variant used by this paint object - */ - FontVariant getFontVariant() const { return fFontVariant; } - - /** Set the font variant - @param fontVariant set the paint's font variant for choosing fonts - */ - void setFontVariant(FontVariant fontVariant) { - SkASSERT((unsigned)fontVariant <= kLast_Variant); - fFontVariant = fontVariant; - } - -private: - SkLanguage fLanguage; - FontVariant fFontVariant; -}; - -#endif // #ifndef SkPaintOptionsAndroid_DEFINED diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index e3b33e9438..1e8b364145 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -230,13 +230,14 @@ private: // V29: Removed SaveFlags parameter from save(). // V30: Remove redundant SkMatrix from SkLocalMatrixShader. // V31: Add a serialized UniqueID to SkImageFilter. + // V32: Removed SkPaintOptionsAndroid from SkPaint // Note: If the picture version needs to be increased then please follow the // steps to generate new SKPs in (only accessible to Googlers): http://goo.gl/qATVcw // Only SKPs within the min/current picture version range (inclusive) can be read. static const uint32_t MIN_PICTURE_VERSION = 19; - static const uint32_t CURRENT_PICTURE_VERSION = 31; + static const uint32_t CURRENT_PICTURE_VERSION = 32; mutable uint32_t fUniqueID; diff --git a/include/core/SkReadBuffer.h b/include/core/SkReadBuffer.h index 2f04614a2b..cd3468670d 100644 --- a/include/core/SkReadBuffer.h +++ b/include/core/SkReadBuffer.h @@ -47,6 +47,7 @@ public: kNoMoreBitmapFlatten_Version = 28, kSimplifyLocalMatrix_Version = 30, kImageFilterUniqueID_Version = 31, + kRemoveAndroidPaintOpts_Version = 32, }; /** |