OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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 "SkMorphologyImageFilter.h" | 8 #include "SkMorphologyImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const SkBitmap& source, | 142 const SkBitmap& source, |
143 const Context& ctx, | 143 const Context& ctx, |
144 SkBitmap* dst, | 144 SkBitmap* dst, |
145 SkIPoint* offset) const { | 145 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 bounds; | 156 SkIRect bounds; |
157 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) { | 157 if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 SkBitmap* result, SkIPoint* offset) con
st { | 581 SkBitmap* result, SkIPoint* offset) con
st { |
582 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 582 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
583 } | 583 } |
584 | 584 |
585 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 585 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
586 SkBitmap* result, SkIPoint* offset) cons
t { | 586 SkBitmap* result, SkIPoint* offset) cons
t { |
587 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 587 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
588 } | 588 } |
589 | 589 |
590 #endif | 590 #endif |
OLD | NEW |