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

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

Issue 473543004: Revert of Remove SkPaintOptionsAndroid (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/SkPaintOptionsAndroid.cpp ('k') | src/core/SkScalerContext.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkScalerContext_DEFINED 8 #ifndef SkScalerContext_DEFINED
9 #define SkScalerContext_DEFINED 9 #define SkScalerContext_DEFINED
10 10
11 #include "SkMask.h" 11 #include "SkMask.h"
12 #include "SkMaskGamma.h" 12 #include "SkMaskGamma.h"
13 #include "SkMatrix.h" 13 #include "SkMatrix.h"
14 #include "SkPaint.h" 14 #include "SkPaint.h"
15 #include "SkTypeface.h" 15 #include "SkTypeface.h"
16 16
17 #ifdef SK_BUILD_FOR_ANDROID
18 #include "SkPaintOptionsAndroid.h"
19 #endif
20
17 struct SkGlyph; 21 struct SkGlyph;
18 class SkDescriptor; 22 class SkDescriptor;
19 class SkMaskFilter; 23 class SkMaskFilter;
20 class SkPathEffect; 24 class SkPathEffect;
21 class SkRasterizer; 25 class SkRasterizer;
22 26
23 /* 27 /*
24 * To allow this to be forward-declared, it must be its own typename, rather 28 * To allow this to be forward-declared, it must be its own typename, rather
25 * than a nested struct inside SkScalerContext (where it started). 29 * than a nested struct inside SkScalerContext (where it started).
26 */ 30 */
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 * The default implementation always returns 0, indicating failure. 255 * The default implementation always returns 0, indicating failure.
252 */ 256 */
253 virtual SkUnichar generateGlyphToChar(uint16_t glyphId); 257 virtual SkUnichar generateGlyphToChar(uint16_t glyphId);
254 258
255 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; } 259 void forceGenerateImageFromPath() { fGenerateImageFromPath = true; }
256 260
257 private: 261 private:
258 // never null 262 // never null
259 SkAutoTUnref<SkTypeface> fTypeface; 263 SkAutoTUnref<SkTypeface> fTypeface;
260 264
265 #ifdef SK_BUILD_FOR_ANDROID
266 SkPaintOptionsAndroid fPaintOptionsAndroid;
267 #endif
268
261 // optional object, which may be null 269 // optional object, which may be null
262 SkPathEffect* fPathEffect; 270 SkPathEffect* fPathEffect;
263 SkMaskFilter* fMaskFilter; 271 SkMaskFilter* fMaskFilter;
264 SkRasterizer* fRasterizer; 272 SkRasterizer* fRasterizer;
265 273
266 // if this is set, we draw the image from a path, rather than 274 // if this is set, we draw the image from a path, rather than
267 // calling generateImage. 275 // calling generateImage.
268 bool fGenerateImageFromPath; 276 bool fGenerateImageFromPath;
269 277
270 void internalGetPath(const SkGlyph& glyph, SkPath* fillPath, 278 void internalGetPath(const SkGlyph& glyph, SkPath* fillPath,
(...skipping 11 matching lines...) Expand all
282 private: 290 private:
283 // When there is a filter, previous steps must create a linear mask 291 // When there is a filter, previous steps must create a linear mask
284 // and the pre-blend applied as a final step. 292 // and the pre-blend applied as a final step.
285 const SkMaskGamma::PreBlend fPreBlendForFilter; 293 const SkMaskGamma::PreBlend fPreBlendForFilter;
286 }; 294 };
287 295
288 #define kRec_SkDescriptorTag SkSetFourByteTag('s', 'r', 'e', 'c') 296 #define kRec_SkDescriptorTag SkSetFourByteTag('s', 'r', 'e', 'c')
289 #define kPathEffect_SkDescriptorTag SkSetFourByteTag('p', 't', 'h', 'e') 297 #define kPathEffect_SkDescriptorTag SkSetFourByteTag('p', 't', 'h', 'e')
290 #define kMaskFilter_SkDescriptorTag SkSetFourByteTag('m', 's', 'k', 'f') 298 #define kMaskFilter_SkDescriptorTag SkSetFourByteTag('m', 's', 'k', 'f')
291 #define kRasterizer_SkDescriptorTag SkSetFourByteTag('r', 'a', 's', 't') 299 #define kRasterizer_SkDescriptorTag SkSetFourByteTag('r', 'a', 's', 't')
300 #ifdef SK_BUILD_FOR_ANDROID
301 #define kAndroidOpts_SkDescriptorTag SkSetFourByteTag('a', 'n', 'd', 'r')
302 #endif
292 303
293 /////////////////////////////////////////////////////////////////////////////// 304 ///////////////////////////////////////////////////////////////////////////////
294 305
295 enum SkAxisAlignment { 306 enum SkAxisAlignment {
296 kNone_SkAxisAlignment, 307 kNone_SkAxisAlignment,
297 kX_SkAxisAlignment, 308 kX_SkAxisAlignment,
298 kY_SkAxisAlignment 309 kY_SkAxisAlignment
299 }; 310 };
300 311
301 /** 312 /**
(...skipping 12 matching lines...) Expand all
314 return static_cast<SkPaint::Hinting>(hint); 325 return static_cast<SkPaint::Hinting>(hint);
315 } 326 }
316 327
317 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { 328 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) {
318 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | 329 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) |
319 (hinting << SkScalerContext::kHinting_Shift); 330 (hinting << SkScalerContext::kHinting_Shift);
320 } 331 }
321 332
322 333
323 #endif 334 #endif
OLDNEW
« no previous file with comments | « src/core/SkPaintOptionsAndroid.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698