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

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: addressing comments 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
« no previous file with comments | « src/core/SkScalerContext.h ('k') | src/ports/SkFontHost_android.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 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 if (data) {
117 SkOrderedReadBuffer buffer(data, len);
118 fPaintOptionsAndroid.unflatten(buffer);
119 SkASSERT(buffer.offset() == buffer.size());
120 }
121 #endif
113 } 122 }
114 123
115 SkScalerContext::~SkScalerContext() { 124 SkScalerContext::~SkScalerContext() {
116 SkDELETE(fNextContext); 125 SkDELETE(fNextContext);
117 126
118 SkSafeUnref(fPathEffect); 127 SkSafeUnref(fPathEffect);
119 SkSafeUnref(fMaskFilter); 128 SkSafeUnref(fMaskFilter);
120 SkSafeUnref(fRasterizer); 129 SkSafeUnref(fRasterizer);
121 } 130 }
122 131
123 // Return the context associated with the next logical typeface, or NULL if 132 // Return the context associated with the next logical typeface, or NULL if
124 // there are no more entries in the fallback chain. 133 // there are no more entries in the fallback chain.
125 SkScalerContext* SkScalerContext::allocNextContext() const { 134 SkScalerContext* SkScalerContext::allocNextContext() const {
126 #ifdef SK_BUILD_FOR_ANDROID 135 #ifdef SK_BUILD_FOR_ANDROID
127 SkTypeface* newFace = SkAndroidNextLogicalTypeface(fRec.fFontID, 136 SkTypeface* newFace = SkAndroidNextLogicalTypeface(fRec.fFontID,
128 fRec.fOrigFontID); 137 fRec.fOrigFontID,
138 fPaintOptionsAndroid);
129 if (0 == newFace) { 139 if (0 == newFace) {
130 return NULL; 140 return NULL;
131 } 141 }
132 142
133 SkAutoTUnref<SkTypeface> aur(newFace); 143 SkAutoTUnref<SkTypeface> aur(newFace);
134 uint32_t newFontID = newFace->uniqueID(); 144 uint32_t newFontID = newFace->uniqueID();
135 145
136 SkAutoDescriptor ad(sizeof(fRec) + SkDescriptor::ComputeOverhead(1)); 146 SkAutoDescriptor ad(sizeof(fRec) + SkDescriptor::ComputeOverhead(1));
137 SkDescriptor* desc = ad.getDesc(); 147 SkDescriptor* desc = ad.getDesc();
138 148
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc); 859 SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc);
850 if (NULL == c) { 860 if (NULL == c) {
851 c = this->onCreateScalerContext(desc); 861 c = this->onCreateScalerContext(desc);
852 } 862 }
853 if (NULL == c) { 863 if (NULL == c) {
854 c = SkNEW_ARGS(SkScalerContext_Empty, 864 c = SkNEW_ARGS(SkScalerContext_Empty,
855 (const_cast<SkTypeface*>(this), desc)); 865 (const_cast<SkTypeface*>(this), desc));
856 } 866 }
857 return c; 867 return c;
858 } 868 }
OLDNEW
« no previous file with comments | « src/core/SkScalerContext.h ('k') | src/ports/SkFontHost_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698