| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 SkVector radius = SkVector::Make(SkIntToScalar(this->radius().width()), | 69 SkVector radius = SkVector::Make(SkIntToScalar(this->radius().width()), |
| 70 SkIntToScalar(this->radius().height())); | 70 SkIntToScalar(this->radius().height())); |
| 71 ctm.mapVectors(&radius, 1); | 71 ctm.mapVectors(&radius, 1); |
| 72 return src.makeOutset(SkScalarCeilToInt(radius.x()), SkScalarCeilToInt(radiu
s.y())); | 72 return src.makeOutset(SkScalarCeilToInt(radius.x()), SkScalarCeilToInt(radiu
s.y())); |
| 73 } | 73 } |
| 74 | 74 |
| 75 SkFlattenable* SkErodeImageFilter::CreateProc(SkReadBuffer& buffer) { | 75 SkFlattenable* SkErodeImageFilter::CreateProc(SkReadBuffer& buffer) { |
| 76 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 76 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
| 77 const int width = buffer.readInt(); | 77 const int width = buffer.readInt(); |
| 78 const int height = buffer.readInt(); | 78 const int height = buffer.readInt(); |
| 79 return Create(width, height, common.getInput(0), &common.cropRect()); | 79 return Create(width, height, common.getInput(0).get(), &common.cropRect()); |
| 80 } | 80 } |
| 81 | 81 |
| 82 SkFlattenable* SkDilateImageFilter::CreateProc(SkReadBuffer& buffer) { | 82 SkFlattenable* SkDilateImageFilter::CreateProc(SkReadBuffer& buffer) { |
| 83 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 83 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
| 84 const int width = buffer.readInt(); | 84 const int width = buffer.readInt(); |
| 85 const int height = buffer.readInt(); | 85 const int height = buffer.readInt(); |
| 86 return Create(width, height, common.getInput(0), &common.cropRect()); | 86 return Create(width, height, common.getInput(0).get(), &common.cropRect()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 #ifndef SK_IGNORE_TO_STRING | 89 #ifndef SK_IGNORE_TO_STRING |
| 90 void SkErodeImageFilter::toString(SkString* str) const { | 90 void SkErodeImageFilter::toString(SkString* str) const { |
| 91 str->appendf("SkErodeImageFilter: ("); | 91 str->appendf("SkErodeImageFilter: ("); |
| 92 str->appendf("radius: (%d,%d)", this->radius().fWidth, this->radius().fHeigh
t); | 92 str->appendf("radius: (%d,%d)", this->radius().fWidth, this->radius().fHeigh
t); |
| 93 str->append(")"); | 93 str->append(")"); |
| 94 } | 94 } |
| 95 #endif | 95 #endif |
| 96 | 96 |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 inputPixmap.rowBytesAsPixels(), | 614 inputPixmap.rowBytesAsPixels(), |
| 615 &dst, height, srcBounds); | 615 &dst, height, srcBounds); |
| 616 } | 616 } |
| 617 offset->fX = bounds.left(); | 617 offset->fX = bounds.left(); |
| 618 offset->fY = bounds.top(); | 618 offset->fY = bounds.top(); |
| 619 | 619 |
| 620 return SkSpecialImage::MakeFromRaster(source->internal_getProxy(), | 620 return SkSpecialImage::MakeFromRaster(source->internal_getProxy(), |
| 621 SkIRect::MakeWH(bounds.width(), bounds
.height()), | 621 SkIRect::MakeWH(bounds.width(), bounds
.height()), |
| 622 dst); | 622 dst); |
| 623 } | 623 } |
| OLD | NEW |