Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 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 "SkDisplacementMapEffect.h" | 8 #include "SkDisplacementMapEffect.h" |
| 9 #include "SkFlattenableBuffers.h" | 9 #include "SkFlattenableBuffers.h" |
| 10 #include "SkUnPreMultiply.h" | 10 #include "SkUnPreMultiply.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, | 181 bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, |
| 182 const SkBitmap& src, | 182 const SkBitmap& src, |
| 183 const SkMatrix& ctm, | 183 const SkMatrix& ctm, |
| 184 SkBitmap* dst, | 184 SkBitmap* dst, |
| 185 SkIPoint* offset) { | 185 SkIPoint* offset) { |
| 186 SkBitmap displ, color = src; | 186 SkBitmap displ, color = src; |
| 187 SkImageFilter* colorInput = getColorInput(); | 187 SkImageFilter* colorInput = getColorInput(); |
| 188 SkImageFilter* displacementInput = getDisplacementInput(); | 188 SkImageFilter* displacementInput = getDisplacementInput(); |
| 189 SkASSERT(NULL != displacementInput); | 189 SkASSERT(NULL != displacementInput); |
| 190 if ((colorInput && !colorInput->filterImage(proxy, src, ctm, &color, offset) ) || | 190 if ((colorInput && !colorInput->filterImage(proxy, src, ctm, &color, offset) ) || |
| 191 !displacementInput->filterImage(proxy, src, ctm, &displ, offset)) { | 191 !displacementInput || !displacementInput->filterImage(proxy, src, ctm, & displ, offset)) { |
|
Stephen White
2013/12/18 00:01:14
I don't think it should abort on a NULL displaceme
| |
| 192 return false; | 192 return false; |
| 193 } | 193 } |
| 194 if ((displ.config() != SkBitmap::kARGB_8888_Config) || | 194 if ((displ.config() != SkBitmap::kARGB_8888_Config) || |
| 195 (color.config() != SkBitmap::kARGB_8888_Config)) { | 195 (color.config() != SkBitmap::kARGB_8888_Config)) { |
| 196 return false; | 196 return false; |
| 197 } | 197 } |
| 198 | 198 |
| 199 SkAutoLockPixels alp_displacement(displ), alp_color(color); | 199 SkAutoLockPixels alp_displacement(displ), alp_color(color); |
| 200 if (!displ.getPixels() || !color.getPixels()) { | 200 if (!displ.getPixels() || !color.getPixels()) { |
| 201 return false; | 201 return false; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 540 const GrGLCaps&) { | 540 const GrGLCaps&) { |
| 541 const GrDisplacementMapEffect& displacementMap = | 541 const GrDisplacementMapEffect& displacementMap = |
| 542 drawEffect.castEffect<GrDisplacementMapEffect>(); | 542 drawEffect.castEffect<GrDisplacementMapEffect>(); |
| 543 | 543 |
| 544 EffectKey xKey = displacementMap.xChannelSelector(); | 544 EffectKey xKey = displacementMap.xChannelSelector(); |
| 545 EffectKey yKey = displacementMap.yChannelSelector() << SkDisplacementMapEffe ct::kKeyBits; | 545 EffectKey yKey = displacementMap.yChannelSelector() << SkDisplacementMapEffe ct::kKeyBits; |
| 546 | 546 |
| 547 return xKey | yKey; | 547 return xKey | yKey; |
| 548 } | 548 } |
| 549 #endif | 549 #endif |
| OLD | NEW |