Index: src/core/SkScalerContext.cpp |
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp |
index d355d8843fea5e2ca06bd06b31785d597f9c0b4a..729d194503c0e905c17f089402c7eb27521db15f 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(); |