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 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, | 54 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, |
55 int radiusY, | 55 int radiusY, |
56 sk_sp<SkImageFilter> input, | 56 sk_sp<SkImageFilter> input, |
57 const CropRect* cropRect) | 57 const CropRect* cropRect) |
58 : INHERITED(&input, 1, cropRect) | 58 : INHERITED(&input, 1, cropRect) |
59 , fRadius(SkISize::Make(radiusX, radiusY)) { | 59 , fRadius(SkISize::Make(radiusX, radiusY)) { |
60 } | 60 } |
61 | 61 |
62 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const { | 62 void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const { |
63 this->INHERITED::flatten(buffer); | 63 this->INHERITED::flatten(buffer); |
64 buffer.writeInt(fRadius.fWidth); | 64 buffer.writeInt("radiusWidth", fRadius.fWidth); |
65 buffer.writeInt(fRadius.fHeight); | 65 buffer.writeInt("radiusHeight", fRadius.fHeight); |
66 } | 66 } |
67 | 67 |
68 static void call_proc_X(SkMorphologyImageFilter::Proc procX, | 68 static void call_proc_X(SkMorphologyImageFilter::Proc procX, |
69 const SkBitmap& src, SkBitmap* dst, | 69 const SkBitmap& src, SkBitmap* dst, |
70 int radiusX, const SkIRect& bounds) { | 70 int radiusX, const SkIRect& bounds) { |
71 procX(src.getAddr32(bounds.left(), bounds.top()), dst->getAddr32(0, 0), | 71 procX(src.getAddr32(bounds.left(), bounds.top()), dst->getAddr32(0, 0), |
72 radiusX, bounds.width(), bounds.height(), | 72 radiusX, bounds.width(), bounds.height(), |
73 src.rowBytesAsPixels(), dst->rowBytesAsPixels()); | 73 src.rowBytesAsPixels(), dst->rowBytesAsPixels()); |
74 } | 74 } |
75 | 75 |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), | 639 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), |
640 inputBM.rowBytesAsPixels(), | 640 inputBM.rowBytesAsPixels(), |
641 &dst, height, srcBounds); | 641 &dst, height, srcBounds); |
642 } | 642 } |
643 offset->fX = bounds.left(); | 643 offset->fX = bounds.left(); |
644 offset->fY = bounds.top(); | 644 offset->fY = bounds.top(); |
645 | 645 |
646 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds
.height()), | 646 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds
.height()), |
647 dst, &source->props()); | 647 dst, &source->props()); |
648 } | 648 } |
OLD | NEW |