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

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

Issue 14761003: API modifications needed to upstream Android font changes. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix whitespace Created 7 years, 7 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 | Annotate | Revision Log
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 SkDebugf(" textsize %g prescale %g preskew %g post [%g %g %g %g]\n", 103 SkDebugf(" textsize %g prescale %g preskew %g post [%g %g %g %g]\n",
104 rec->fTextSize, rec->fPreScaleX, rec->fPreSkewX, rec->fPost2x2[0][0], 104 rec->fTextSize, rec->fPreScaleX, rec->fPreSkewX, rec->fPost2x2[0][0],
105 rec->fPost2x2[0][1], rec->fPost2x2[1][0], rec->fPost2x2[1][1]); 105 rec->fPost2x2[0][1], rec->fPost2x2[1][0], rec->fPost2x2[1][1]);
106 SkDebugf(" frame %g miter %g hints %d framefill %d format %d join %d\n", 106 SkDebugf(" frame %g miter %g hints %d framefill %d format %d join %d\n",
107 rec->fFrameWidth, rec->fMiterLimit, rec->fHints, rec->fFrameAndFill, 107 rec->fFrameWidth, rec->fMiterLimit, rec->fHints, rec->fFrameAndFill,
108 rec->fMaskFormat, rec->fStrokeJoin); 108 rec->fMaskFormat, rec->fStrokeJoin);
109 SkDebugf(" pathEffect %x maskFilter %x\n", 109 SkDebugf(" pathEffect %x maskFilter %x\n",
110 desc->findEntry(kPathEffect_SkDescriptorTag, NULL), 110 desc->findEntry(kPathEffect_SkDescriptorTag, NULL),
111 desc->findEntry(kMaskFilter_SkDescriptorTag, NULL)); 111 desc->findEntry(kMaskFilter_SkDescriptorTag, NULL));
112 #endif 112 #endif
113 #ifdef SK_BUILD_FOR_ANDROID
114 uint32_t len;
115 const void* data = desc->findEntry(kAndroidOpts_SkDescriptorTag, &len);
116 SkASSERT(data);
117 SkOrderedReadBuffer buffer(data, len);
118 fPaintOptionsAndroid.unflatten(buffer);
119 SkASSERT(buffer.offset() == buffer.size());
120 #endif
113 } 121 }
114 122
115 SkScalerContext::~SkScalerContext() { 123 SkScalerContext::~SkScalerContext() {
116 SkDELETE(fNextContext); 124 SkDELETE(fNextContext);
117 125
118 SkSafeUnref(fPathEffect); 126 SkSafeUnref(fPathEffect);
119 SkSafeUnref(fMaskFilter); 127 SkSafeUnref(fMaskFilter);
120 SkSafeUnref(fRasterizer); 128 SkSafeUnref(fRasterizer);
121 } 129 }
122 130
123 // Return the context associated with the next logical typeface, or NULL if 131 // Return the context associated with the next logical typeface, or NULL if
124 // there are no more entries in the fallback chain. 132 // there are no more entries in the fallback chain.
125 SkScalerContext* SkScalerContext::allocNextContext() const { 133 SkScalerContext* SkScalerContext::allocNextContext() const {
126 #ifdef SK_BUILD_FOR_ANDROID 134 #ifdef SK_BUILD_FOR_ANDROID
127 SkTypeface* newFace = SkAndroidNextLogicalTypeface(fRec.fFontID, 135 SkTypeface* newFace = SkAndroidNextLogicalTypeface(fRec.fFontID,
128 fRec.fOrigFontID); 136 fRec.fOrigFontID,
137 fPaintOptionsAndroid);
129 if (0 == newFace) { 138 if (0 == newFace) {
130 return NULL; 139 return NULL;
131 } 140 }
132 141
133 SkAutoTUnref<SkTypeface> aur(newFace); 142 SkAutoTUnref<SkTypeface> aur(newFace);
134 uint32_t newFontID = newFace->uniqueID(); 143 uint32_t newFontID = newFace->uniqueID();
135 144
136 SkAutoDescriptor ad(sizeof(fRec) + SkDescriptor::ComputeOverhead(1)); 145 SkAutoDescriptor ad(sizeof(fRec) + SkDescriptor::ComputeOverhead(1));
137 SkDescriptor* desc = ad.getDesc(); 146 SkDescriptor* desc = ad.getDesc();
138 147
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc); 850 SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc);
842 if (NULL == c) { 851 if (NULL == c) {
843 c = this->onCreateScalerContext(desc); 852 c = this->onCreateScalerContext(desc);
844 } 853 }
845 if (NULL == c) { 854 if (NULL == c) {
846 c = SkNEW_ARGS(SkScalerContext_Empty, 855 c = SkNEW_ARGS(SkScalerContext_Empty,
847 (const_cast<SkTypeface*>(this), desc)); 856 (const_cast<SkTypeface*>(this), desc));
848 } 857 }
849 return c; 858 return c;
850 } 859 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698