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 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 return false; | 1754 return false; |
1755 } | 1755 } |
1756 fDstToUnit.setConcat(im, ctmInv); | 1756 fDstToUnit.setConcat(im, ctmInv); |
1757 return true; | 1757 return true; |
1758 } | 1758 } |
1759 | 1759 |
1760 #include "SkColorPriv.h" | 1760 #include "SkColorPriv.h" |
1761 #include "SkComposeShader.h" | 1761 #include "SkComposeShader.h" |
1762 | 1762 |
1763 static int ScalarTo256(SkScalar v) { | 1763 static int ScalarTo256(SkScalar v) { |
1764 int scale = SkScalarToFixed(v) >> 8; | 1764 return static_cast<int>(SkScalarPin(v, 0, 1) * 256); |
1765 if (scale < 0) { | |
1766 scale = 0; | |
1767 } | |
1768 if (scale > 255) { | |
1769 scale = 255; | |
1770 } | |
1771 return SkAlpha255To256(scale); | |
1772 } | 1765 } |
1773 | 1766 |
1774 | 1767 |
1775 SkTriColorShader::TriColorShaderContext::TriColorShaderContext(const SkTriColorS
hader& shader, | 1768 SkTriColorShader::TriColorShaderContext::TriColorShaderContext(const SkTriColorS
hader& shader, |
1776 const ContextRec&
rec) | 1769 const ContextRec&
rec) |
1777 : INHERITED(shader, rec) {} | 1770 : INHERITED(shader, rec) {} |
1778 | 1771 |
1779 SkTriColorShader::TriColorShaderContext::~TriColorShaderContext() {} | 1772 SkTriColorShader::TriColorShaderContext::~TriColorShaderContext() {} |
1780 | 1773 |
1781 size_t SkTriColorShader::contextSize() const { | 1774 size_t SkTriColorShader::contextSize() const { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 mask->fImage = SkMask::AllocImage(size); | 2055 mask->fImage = SkMask::AllocImage(size); |
2063 memset(mask->fImage, 0, mask->computeImageSize()); | 2056 memset(mask->fImage, 0, mask->computeImageSize()); |
2064 } | 2057 } |
2065 | 2058 |
2066 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2059 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2067 draw_into_mask(*mask, devPath, style); | 2060 draw_into_mask(*mask, devPath, style); |
2068 } | 2061 } |
2069 | 2062 |
2070 return true; | 2063 return true; |
2071 } | 2064 } |
OLD | NEW |