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