OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The Android Open Source Project | 2 * Copyright 2011 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 bool SkBlurImageFilter::onFilterImage(Proxy* proxy, | 143 bool SkBlurImageFilter::onFilterImage(Proxy* proxy, |
144 const SkBitmap& source, const Context& ctx
, | 144 const SkBitmap& source, const Context& ctx
, |
145 SkBitmap* dst, SkIPoint* offset) const { | 145 SkBitmap* dst, SkIPoint* offset) const { |
146 SkBitmap src = source; | 146 SkBitmap src = source; |
147 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 147 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
148 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO
ffset)) { | 148 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO
ffset)) { |
149 return false; | 149 return false; |
150 } | 150 } |
151 | 151 |
152 if (src.colorType() != kN32_SkColorType) { | 152 if (src.colorType() != kPMColor_SkColorType) { |
153 return false; | 153 return false; |
154 } | 154 } |
155 | 155 |
156 SkIRect srcBounds, dstBounds; | 156 SkIRect srcBounds, dstBounds; |
157 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &srcBounds, &src)) { | 157 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &srcBounds, &src)) { |
158 return false; | 158 return false; |
159 } | 159 } |
160 | 160 |
161 SkAutoLockPixels alp(src); | 161 SkAutoLockPixels alp(src); |
162 if (!src.getPixels()) { | 162 if (!src.getPixels()) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 true, | 284 true, |
285 sigma.x(), | 285 sigma.x(), |
286 sigma.y())); | 286 sigma.y())); |
287 WrapTexture(tex, rect.width(), rect.height(), result); | 287 WrapTexture(tex, rect.width(), rect.height(), result); |
288 return true; | 288 return true; |
289 #else | 289 #else |
290 SkDEBUGFAIL("Should not call in GPU-less build"); | 290 SkDEBUGFAIL("Should not call in GPU-less build"); |
291 return false; | 291 return false; |
292 #endif | 292 #endif |
293 } | 293 } |
OLD | NEW |