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

Side by Side Diff: src/core/SkScalerContext.cpp

Issue 137433003: Convert SkWriter32 to use an SkTDArray for its internal storage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: of course 0's fine too... Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkScalerContext.h" 10 #include "SkScalerContext.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 SkTypeface* newFace = SkAndroidNextLogicalTypeface(fRec.fFontID, 140 SkTypeface* newFace = SkAndroidNextLogicalTypeface(fRec.fFontID,
141 fRec.fOrigFontID, 141 fRec.fOrigFontID,
142 fPaintOptionsAndroid); 142 fPaintOptionsAndroid);
143 if (0 == newFace) { 143 if (0 == newFace) {
144 return NULL; 144 return NULL;
145 } 145 }
146 146
147 SkAutoTUnref<SkTypeface> aur(newFace); 147 SkAutoTUnref<SkTypeface> aur(newFace);
148 uint32_t newFontID = newFace->uniqueID(); 148 uint32_t newFontID = newFace->uniqueID();
149 149
150 SkOrderedWriteBuffer androidBuffer(128); 150 SkOrderedWriteBuffer androidBuffer;
151 fPaintOptionsAndroid.flatten(androidBuffer); 151 fPaintOptionsAndroid.flatten(androidBuffer);
152 152
153 SkAutoDescriptor ad(sizeof(fRec) + androidBuffer.size() + SkDescriptor::C omputeOverhead(2)); 153 SkAutoDescriptor ad(sizeof(fRec) + androidBuffer.size() + SkDescriptor::C omputeOverhead(2));
154 SkDescriptor* desc = ad.getDesc(); 154 SkDescriptor* desc = ad.getDesc();
155 155
156 desc->init(); 156 desc->init();
157 SkScalerContext::Rec* newRec = 157 SkScalerContext::Rec* newRec =
158 (SkScalerContext::Rec*)desc->addEntry(kRec_SkDescriptorTag, 158 (SkScalerContext::Rec*)desc->addEntry(kRec_SkDescriptorTag,
159 sizeof(fRec), &fRec); 159 sizeof(fRec), &fRec);
160 androidBuffer.writeToMemory(desc->addEntry(kAndroidOpts_SkDescriptorTag, 160 androidBuffer.writeToMemory(desc->addEntry(kAndroidOpts_SkDescriptorTag,
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, 980 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc,
981 bool allowFailure) const { 981 bool allowFailure) const {
982 SkScalerContext* c = this->onCreateScalerContext(desc); 982 SkScalerContext* c = this->onCreateScalerContext(desc);
983 983
984 if (!c && !allowFailure) { 984 if (!c && !allowFailure) {
985 c = SkNEW_ARGS(SkScalerContext_Empty, 985 c = SkNEW_ARGS(SkScalerContext_Empty,
986 (const_cast<SkTypeface*>(this), desc)); 986 (const_cast<SkTypeface*>(this), desc));
987 } 987 }
988 return c; 988 return c;
989 } 989 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698