diff options
author | 2014-08-06 16:30:51 -0400 | |
---|---|---|
committer | 2014-08-06 16:30:51 -0400 | |
commit | 27fb94999b8eec448423884e1d071e563c4c95d9 (patch) | |
tree | 47d468b303a1a081411a7dd776c3f3593f6508f6 /include/core | |
parent | 8560cd5396f8902322471b49ac33aa849659228e (diff) |
Remove SkPaintOptionsAndroid
Review URL: https://codereview.chromium.org/447873003
Diffstat (limited to 'include/core')
-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 c733e532c2..e0a425f807 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -231,13 +231,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 2beb7ac738..a760614585 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, }; /** |