| OLD | NEW |
| 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 */ |
| 27 struct SkScalerContextRec { | 31 struct SkScalerContextRec { |
| 28 uint32_t fOrigFontID; | 32 uint32_t fOrigFontID; |
| 29 uint32_t fFontID; | 33 uint32_t fFontID; |
| 30 SkScalar fTextSize, fPreScaleX, fPreSkewX; | 34 SkScalar fTextSize, fPreScaleX, fPreSkewX; |
| 31 SkScalar fPost2x2[2][2]; | 35 SkScalar fPost2x2[2][2]; |
| 32 SkScalar fFrameWidth, fMiterLimit; | 36 SkScalar fFrameWidth, fMiterLimit; |
| 33 #ifdef SK_SUPPORT_HINTING_SCALE_FACTOR | 37 #ifdef SK_SUPPORT_HINTING_SCALE_FACTOR |
| 34 SkScalar fHintingScaleFactor; | 38 SkScalar fHintingScaleFactor; |
| 35 #endif | 39 #endif |
| 40 #ifdef SK_BUILD_FOR_ANDROID |
| 41 SkPaintOptionsAndroid fPaintOptionsAndroid; |
| 42 #endif |
| 36 | 43 |
| 37 //These describe the parameters to create (uniquely identify) the pre-blend. | 44 //These describe the parameters to create (uniquely identify) the pre-blend. |
| 38 uint32_t fLumBits; | 45 uint32_t fLumBits; |
| 39 uint8_t fDeviceGamma; //2.6, (0.0, 4.0) gamma, 0.0 for sRGB | 46 uint8_t fDeviceGamma; //2.6, (0.0, 4.0) gamma, 0.0 for sRGB |
| 40 uint8_t fPaintGamma; //2.6, (0.0, 4.0) gamma, 0.0 for sRGB | 47 uint8_t fPaintGamma; //2.6, (0.0, 4.0) gamma, 0.0 for sRGB |
| 41 uint8_t fContrast; //0.8+1, [0.0, 1.0] artificial contrast | 48 uint8_t fContrast; //0.8+1, [0.0, 1.0] artificial contrast |
| 42 uint8_t fReservedAlign; | 49 uint8_t fReservedAlign; |
| 43 | 50 |
| 44 SkScalar getDeviceGamma() const { | 51 SkScalar getDeviceGamma() const { |
| 45 return SkIntToScalar(fDeviceGamma) / (1 << 6); | 52 return SkIntToScalar(fDeviceGamma) / (1 << 6); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 return static_cast<SkPaint::Hinting>(hint); | 295 return static_cast<SkPaint::Hinting>(hint); |
| 289 } | 296 } |
| 290 | 297 |
| 291 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { | 298 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { |
| 292 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | | 299 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | |
| 293 (hinting << SkScalerContext::kHinting_Shift); | 300 (hinting << SkScalerContext::kHinting_Shift); |
| 294 } | 301 } |
| 295 | 302 |
| 296 | 303 |
| 297 #endif | 304 #endif |
| OLD | NEW |