aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkPaintOptionsAndroid.h6
-rw-r--r--src/core/SkScalerContext.cpp9
-rw-r--r--src/images/SkMovie_gif.cpp10
-rw-r--r--src/ports/SkFontConfigInterface_android.cpp2
4 files changed, 20 insertions, 7 deletions
diff --git a/include/core/SkPaintOptionsAndroid.h b/include/core/SkPaintOptionsAndroid.h
index 7a2ea8f7ca..78e43868c0 100644
--- a/include/core/SkPaintOptionsAndroid.h
+++ b/include/core/SkPaintOptionsAndroid.h
@@ -94,9 +94,9 @@ public:
enum FontVariant {
- kDefault_Variant, // Currently setting yourself to Default gives you Compact Variant
- kCompact_Variant,
- kElegant_Variant,
+ kDefault_Variant = 0x01, // Currently setting yourself to Default gives you Compact Variant
+ kCompact_Variant = 0x02,
+ kElegant_Variant = 0x04,
kLast_Variant = kElegant_Variant,
};
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 95360cd0a9..ee9d919427 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -16,6 +16,7 @@
#include "SkMaskFilter.h"
#include "SkMaskGamma.h"
#include "SkOrderedReadBuffer.h"
+#include "SkOrderedWriteBuffer.h"
#include "SkPathEffect.h"
#include "SkRasterizer.h"
#include "SkRasterClip.h"
@@ -143,13 +144,19 @@ SkScalerContext* SkScalerContext::allocNextContext() const {
SkAutoTUnref<SkTypeface> aur(newFace);
uint32_t newFontID = newFace->uniqueID();
- SkAutoDescriptor ad(sizeof(fRec) + SkDescriptor::ComputeOverhead(1));
+ SkOrderedWriteBuffer androidBuffer(128);
+ fPaintOptionsAndroid.flatten(androidBuffer);
+
+ SkAutoDescriptor ad(sizeof(fRec) + androidBuffer.size() + SkDescriptor::ComputeOverhead(2));
SkDescriptor* desc = ad.getDesc();
desc->init();
SkScalerContext::Rec* newRec =
(SkScalerContext::Rec*)desc->addEntry(kRec_SkDescriptorTag,
sizeof(fRec), &fRec);
+ androidBuffer.writeToMemory(desc->addEntry(kAndroidOpts_SkDescriptorTag,
+ androidBuffer.size(), NULL));
+
newRec->fFontID = newFontID;
desc->computeChecksum();
diff --git a/src/images/SkMovie_gif.cpp b/src/images/SkMovie_gif.cpp
index 313bb2ce83..315816812a 100644
--- a/src/images/SkMovie_gif.cpp
+++ b/src/images/SkMovie_gif.cpp
@@ -123,6 +123,7 @@ static void copyLine(uint32_t* dst, const unsigned char* src, const ColorMapObje
}
}
+#if GIFLIB_MAJOR < 5
static void copyInterlaceGroup(SkBitmap* bm, const unsigned char*& src,
const ColorMapObject* cmap, int transparent, int copyWidth,
int copyHeight, const GifImageDesc& imageDesc, int rowStep,
@@ -169,6 +170,7 @@ static void blitInterlace(SkBitmap* bm, const SavedImage* frame, const ColorMapO
copyInterlaceGroup(bm, src, cmap, transparent, copyWidth, copyHeight, frame->ImageDesc, 2, 1);
}
+#endif
static void blitNormal(SkBitmap* bm, const SavedImage* frame, const ColorMapObject* cmap,
int transparent)
@@ -241,11 +243,15 @@ static void drawFrame(SkBitmap* bm, const SavedImage* frame, const ColorMapObjec
return;
}
+#if GIFLIB_MAJOR < 5
+ // before GIFLIB 5, de-interlacing wasn't done by library at load time
if (frame->ImageDesc.Interlace) {
blitInterlace(bm, frame, cmap, transparent);
- } else {
- blitNormal(bm, frame, cmap, transparent);
+ return;
}
+#endif
+
+ blitNormal(bm, frame, cmap, transparent);
}
static bool checkIfWillBeCleared(const SavedImage* frame)
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp
index 738b11434e..e9886188b2 100644
--- a/src/ports/SkFontConfigInterface_android.cpp
+++ b/src/ports/SkFontConfigInterface_android.cpp
@@ -593,7 +593,7 @@ SkTypeface* SkFontConfigInterfaceAndroid::nextLogicalTypeface(SkFontID currFontI
const SkTypeface* currTypeface = SkTypefaceCache::FindByID(currFontID);
// non-system fonts are not in the font cache so if we are asked to fallback
// for a non-system font we will start at the front of the chain.
- if (NULL != currTypeface && currFontID == origFontID) {
+ if (NULL != currTypeface && currFontID != origFontID) {
currFontRecID = ((FontConfigTypeface*)currTypeface)->getIdentity().fID;
SkASSERT(INVALID_FONT_REC_ID != currFontRecID);
}