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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 int kernelSizeX, kernelSizeX3, lowOffsetX, highOffsetX; | 171 int kernelSizeX, kernelSizeX3, lowOffsetX, highOffsetX; |
172 int kernelSizeY, kernelSizeY3, lowOffsetY, highOffsetY; | 172 int kernelSizeY, kernelSizeY3, lowOffsetY, highOffsetY; |
173 getBox3Params(sigma.x(), &kernelSizeX, &kernelSizeX3, &lowOffsetX, &highOffs
etX); | 173 getBox3Params(sigma.x(), &kernelSizeX, &kernelSizeX3, &lowOffsetX, &highOffs
etX); |
174 getBox3Params(sigma.y(), &kernelSizeY, &kernelSizeY3, &lowOffsetY, &highOffs
etY); | 174 getBox3Params(sigma.y(), &kernelSizeY, &kernelSizeY3, &lowOffsetY, &highOffs
etY); |
175 | 175 |
176 if (kernelSizeX < 0 || kernelSizeY < 0) { | 176 if (kernelSizeX < 0 || kernelSizeY < 0) { |
177 return false; | 177 return false; |
178 } | 178 } |
179 | 179 |
180 if (kernelSizeX == 0 && kernelSizeY == 0) { | 180 if (kernelSizeX == 0 && kernelSizeY == 0) { |
181 src.copyTo(dst, dst->config()); | 181 src.copyTo(dst, dst->colorType()); |
182 offset->fX = srcBounds.fLeft; | 182 offset->fX = srcBounds.fLeft; |
183 offset->fY = srcBounds.fTop; | 183 offset->fY = srcBounds.fTop; |
184 return true; | 184 return true; |
185 } | 185 } |
186 | 186 |
187 SkBitmap temp; | 187 SkBitmap temp; |
188 temp.setConfig(dst->config(), dst->width(), dst->height()); | 188 temp.setConfig(dst->config(), dst->width(), dst->height()); |
189 if (!temp.allocPixels()) { | 189 if (!temp.allocPixels()) { |
190 return false; | 190 return false; |
191 } | 191 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 SkRect::Make(rect), | 277 SkRect::Make(rect), |
278 true, | 278 true, |
279 sigma.x(), | 279 sigma.x(), |
280 sigma.y())); | 280 sigma.y())); |
281 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res
ult); | 281 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res
ult); |
282 #else | 282 #else |
283 SkDEBUGFAIL("Should not call in GPU-less build"); | 283 SkDEBUGFAIL("Should not call in GPU-less build"); |
284 return false; | 284 return false; |
285 #endif | 285 #endif |
286 } | 286 } |
OLD | NEW |