Upstream changes from Android
R=scroggo@google.com Review URL: https://codereview.chromium.org/21053009 git-svn-id: http://skia.googlecode.com/svn/trunk@10461 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
631a59b939
commit
29bf862515
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user