Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: src/core/SkScalerContext.cpp

Issue 21053009: Upstream changes from Android (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPaintOptionsAndroid.h ('k') | src/images/SkMovie_gif.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « include/core/SkPaintOptionsAndroid.h ('k') | src/images/SkMovie_gif.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698