| 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 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 * The second (optional) decomposition is of 'remaining' into a non-rotatio
nal part | 106 * The second (optional) decomposition is of 'remaining' into a non-rotatio
nal part |
| 107 * 'remainingWithoutRotation' and a rotational part 'remainingRotation'. Th
e 'scale' is applied | 107 * 'remainingWithoutRotation' and a rotational part 'remainingRotation'. Th
e 'scale' is applied |
| 108 * first, then 'remainingWithoutRotation', then 'remainingRotation' to full
y apply the total | 108 * first, then 'remainingWithoutRotation', then 'remainingRotation' to full
y apply the total |
| 109 * matrix. This decomposition is helpful when only horizontal metrics can b
e trusted, so the | 109 * matrix. This decomposition is helpful when only horizontal metrics can b
e trusted, so the |
| 110 * 'scale' and 'remainingWithoutRotation' will be handled by the underlying
library, but | 110 * 'scale' and 'remainingWithoutRotation' will be handled by the underlying
library, but |
| 111 * the final rotation 'remainingRotation' will be handled manually. | 111 * the final rotation 'remainingRotation' will be handled manually. |
| 112 * | 112 * |
| 113 * The 'total' matrix is also (optionally) available. This is useful in cas
es where the | 113 * The 'total' matrix is also (optionally) available. This is useful in cas
es where the |
| 114 * underlying library will not be used, often when working directly with fo
nt data. | 114 * underlying library will not be used, often when working directly with fo
nt data. |
| 115 * | 115 * |
| 116 * The parameters 'scale' and 'remaining' are required, the other pointers
may be NULL. | 116 * The parameters 'scale' and 'remaining' are required, the other pointers
may be nullptr. |
| 117 * | 117 * |
| 118 * @param preMatrixScale the kind of scale to extract from the total matrix
. | 118 * @param preMatrixScale the kind of scale to extract from the total matrix
. |
| 119 * @param scale the scale extracted from the total matrix (both values posi
tive). | 119 * @param scale the scale extracted from the total matrix (both values posi
tive). |
| 120 * @param remaining apply after scale to apply the total matrix. | 120 * @param remaining apply after scale to apply the total matrix. |
| 121 * @param remainingWithoutRotation apply after scale to apply the total mat
rix sans rotation. | 121 * @param remainingWithoutRotation apply after scale to apply the total mat
rix sans rotation. |
| 122 * @param remainingRotation apply after remainingWithoutRotation to apply t
he total matrix. | 122 * @param remainingRotation apply after remainingWithoutRotation to apply t
he total matrix. |
| 123 * @param total the total matrix. | 123 * @param total the total matrix. |
| 124 */ | 124 */ |
| 125 void computeMatrices(PreMatrixScale preMatrixScale, | 125 void computeMatrices(PreMatrixScale preMatrixScale, |
| 126 SkVector* scale, SkMatrix* remaining, | 126 SkVector* scale, SkMatrix* remaining, |
| 127 SkMatrix* remainingWithoutRotation = NULL, | 127 SkMatrix* remainingWithoutRotation = nullptr, |
| 128 SkMatrix* remainingRotation = NULL, | 128 SkMatrix* remainingRotation = nullptr, |
| 129 SkMatrix* total = NULL); | 129 SkMatrix* total = nullptr); |
| 130 | 130 |
| 131 inline SkPaint::Hinting getHinting() const; | 131 inline SkPaint::Hinting getHinting() const; |
| 132 inline void setHinting(SkPaint::Hinting); | 132 inline void setHinting(SkPaint::Hinting); |
| 133 | 133 |
| 134 SkMask::Format getFormat() const { | 134 SkMask::Format getFormat() const { |
| 135 return static_cast<SkMask::Format>(fMaskFormat); | 135 return static_cast<SkMask::Format>(fMaskFormat); |
| 136 } | 136 } |
| 137 | 137 |
| 138 SkColor getLuminanceColor() const { | 138 SkColor getLuminanceColor() const { |
| 139 return fLumBits; | 139 return fLumBits; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 SkRasterizer* fRasterizer; | 312 SkRasterizer* fRasterizer; |
| 313 | 313 |
| 314 // if this is set, we draw the image from a path, rather than | 314 // if this is set, we draw the image from a path, rather than |
| 315 // calling generateImage. | 315 // calling generateImage. |
| 316 bool fGenerateImageFromPath; | 316 bool fGenerateImageFromPath; |
| 317 | 317 |
| 318 void internalGetPath(const SkGlyph& glyph, SkPath* fillPath, | 318 void internalGetPath(const SkGlyph& glyph, SkPath* fillPath, |
| 319 SkPath* devPath, SkMatrix* fillToDevMatrix); | 319 SkPath* devPath, SkMatrix* fillToDevMatrix); |
| 320 | 320 |
| 321 // returns the right context from our link-list for this char. If no match | 321 // returns the right context from our link-list for this char. If no match |
| 322 // is found it returns NULL. If a match is found then the glyphID param is | 322 // is found it returns nullptr. If a match is found then the glyphID param i
s |
| 323 // set to the glyphID that maps to the provided char. | 323 // set to the glyphID that maps to the provided char. |
| 324 SkScalerContext* getContextFromChar(SkUnichar uni, uint16_t* glyphID); | 324 SkScalerContext* getContextFromChar(SkUnichar uni, uint16_t* glyphID); |
| 325 | 325 |
| 326 // SkMaskGamma::PreBlend converts linear masks to gamma correcting masks. | 326 // SkMaskGamma::PreBlend converts linear masks to gamma correcting masks. |
| 327 protected: | 327 protected: |
| 328 // Visible to subclasses so that generateImage can apply the pre-blend direc
tly. | 328 // Visible to subclasses so that generateImage can apply the pre-blend direc
tly. |
| 329 const SkMaskGamma::PreBlend fPreBlend; | 329 const SkMaskGamma::PreBlend fPreBlend; |
| 330 private: | 330 private: |
| 331 // When there is a filter, previous steps must create a linear mask | 331 // When there is a filter, previous steps must create a linear mask |
| 332 // and the pre-blend applied as a final step. | 332 // and the pre-blend applied as a final step. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 362 return static_cast<SkPaint::Hinting>(hint); | 362 return static_cast<SkPaint::Hinting>(hint); |
| 363 } | 363 } |
| 364 | 364 |
| 365 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { | 365 void SkScalerContextRec::setHinting(SkPaint::Hinting hinting) { |
| 366 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | | 366 fFlags = (fFlags & ~SkScalerContext::kHinting_Mask) | |
| 367 (hinting << SkScalerContext::kHinting_Shift); | 367 (hinting << SkScalerContext::kHinting_Shift); |
| 368 } | 368 } |
| 369 | 369 |
| 370 | 370 |
| 371 #endif | 371 #endif |
| OLD | NEW |