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 #define __STDC_LIMIT_MACROS | 7 #define __STDC_LIMIT_MACROS |
8 | 8 |
9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
10 #include "SkBlitter.h" | 10 #include "SkBlitter.h" |
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 const SkRegion* const fClip; | 1578 const SkRegion* const fClip; |
1579 const SkDraw& fDraw; | 1579 const SkDraw& fDraw; |
1580 const SkPaint& fPaint; | 1580 const SkPaint& fPaint; |
1581 const SkIRect fClipBounds; | 1581 const SkIRect fClipBounds; |
1582 }; | 1582 }; |
1583 | 1583 |
1584 ////////////////////////////////////////////////////////////////////////////////
//////////////////// | 1584 ////////////////////////////////////////////////////////////////////////////////
//////////////////// |
1585 | 1585 |
1586 uint32_t SkDraw::scalerContextFlags() const { | 1586 uint32_t SkDraw::scalerContextFlags() const { |
1587 uint32_t flags = SkPaint::kBoostContrast_ScalerContextFlag; | 1587 uint32_t flags = SkPaint::kBoostContrast_ScalerContextFlag; |
1588 // TODO: how should we handle non-srgb, non-linear gamma? | 1588 if (!SkImageInfoIsGammaCorrect(fDevice->imageInfo())) { |
1589 if (!fDevice->imageInfo().gammaCloseToSRGB()) { | |
1590 flags |= SkPaint::kFakeGamma_ScalerContextFlag; | 1589 flags |= SkPaint::kFakeGamma_ScalerContextFlag; |
1591 } | 1590 } |
1592 return flags; | 1591 return flags; |
1593 } | 1592 } |
1594 | 1593 |
1595 void SkDraw::drawText(const char text[], size_t byteLength, | 1594 void SkDraw::drawText(const char text[], size_t byteLength, |
1596 SkScalar x, SkScalar y, const SkPaint& paint) const { | 1595 SkScalar x, SkScalar y, const SkPaint& paint) const { |
1597 SkASSERT(byteLength == 0 || text != nullptr); | 1596 SkASSERT(byteLength == 0 || text != nullptr); |
1598 | 1597 |
1599 SkDEBUGCODE(this->validate();) | 1598 SkDEBUGCODE(this->validate();) |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 mask->fImage = SkMask::AllocImage(size); | 2106 mask->fImage = SkMask::AllocImage(size); |
2108 memset(mask->fImage, 0, mask->computeImageSize()); | 2107 memset(mask->fImage, 0, mask->computeImageSize()); |
2109 } | 2108 } |
2110 | 2109 |
2111 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2110 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2112 draw_into_mask(*mask, devPath, style); | 2111 draw_into_mask(*mask, devPath, style); |
2113 } | 2112 } |
2114 | 2113 |
2115 return true; | 2114 return true; |
2116 } | 2115 } |
OLD | NEW |