OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 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 #include "SkBicubicImageFilter.h" | 8 #include "SkBicubicImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const SkBitmap& source, | 84 const SkBitmap& source, |
85 const Context& ctx, | 85 const Context& ctx, |
86 SkBitmap* result, | 86 SkBitmap* result, |
87 SkIPoint* offset) const { | 87 SkIPoint* offset) const { |
88 SkBitmap src = source; | 88 SkBitmap src = source; |
89 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 89 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
90 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO
ffset)) { | 90 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO
ffset)) { |
91 return false; | 91 return false; |
92 } | 92 } |
93 | 93 |
94 if (src.colorType() != kPMColor_SkColorType) { | 94 if (src.colorType() != kN32_SkColorType) { |
95 return false; | 95 return false; |
96 } | 96 } |
97 | 97 |
98 SkAutoLockPixels alp(src); | 98 SkAutoLockPixels alp(src); |
99 if (!src.getPixels()) { | 99 if (!src.getPixels()) { |
100 return false; | 100 return false; |
101 } | 101 } |
102 | 102 |
103 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca
le.fWidth), | 103 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca
le.fWidth), |
104 SkScalarMul(SkIntToScalar(src.height()), fSc
ale.fHeight)); | 104 SkScalarMul(SkIntToScalar(src.height()), fSc
ale.fHeight)); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un
ref(); | 196 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un
ref(); |
197 SkRect srcRect; | 197 SkRect srcRect; |
198 srcBM.getBounds(&srcRect); | 198 srcBM.getBounds(&srcRect); |
199 context->drawRectToRect(paint, dstRect, srcRect); | 199 context->drawRectToRect(paint, dstRect, srcRect); |
200 WrapTexture(dst, desc.fWidth, desc.fHeight, result); | 200 WrapTexture(dst, desc.fWidth, desc.fHeight, result); |
201 return true; | 201 return true; |
202 } | 202 } |
203 #endif | 203 #endif |
204 | 204 |
205 /////////////////////////////////////////////////////////////////////////////// | 205 /////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |