| 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 return nullptr; | 526 return nullptr; |
| 527 } | 527 } |
| 528 | 528 |
| 529 apply_morphology_pass(dstDrawContext, clip, srcTexture, | 529 apply_morphology_pass(dstDrawContext, clip, srcTexture, |
| 530 srcRect, dstRect, radius.fHeight, morphType, | 530 srcRect, dstRect, radius.fHeight, morphType, |
| 531 Gr1DKernelEffect::kY_Direction); | 531 Gr1DKernelEffect::kY_Direction); |
| 532 | 532 |
| 533 srcTexture.reset(scratch); | 533 srcTexture.reset(scratch); |
| 534 } | 534 } |
| 535 | 535 |
| 536 return SkSpecialImage::MakeFromGpu(input->internal_getProxy(), | 536 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(rect.width(), rect.height
()), |
| 537 SkIRect::MakeWH(rect.width(), rect.height
()), | |
| 538 kNeedNewImageUniqueID_SpecialImage, | 537 kNeedNewImageUniqueID_SpecialImage, |
| 539 srcTexture, &input->props()); | 538 srcTexture, &input->props()); |
| 540 } | 539 } |
| 541 #endif | 540 #endif |
| 542 | 541 |
| 543 sk_sp<SkSpecialImage> SkMorphologyImageFilter::onFilterImage(SkSpecialImage* sou
rce, | 542 sk_sp<SkSpecialImage> SkMorphologyImageFilter::onFilterImage(SkSpecialImage* sou
rce, |
| 544 const Context& ctx, | 543 const Context& ctx, |
| 545 SkIPoint* offset) c
onst { | 544 SkIPoint* offset) c
onst { |
| 546 SkIPoint inputOffset = SkIPoint::Make(0, 0); | 545 SkIPoint inputOffset = SkIPoint::Make(0, 0); |
| 547 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset))
; | 546 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset))
; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 call_proc_X(procX, inputBM, &dst, width, srcBounds); | 636 call_proc_X(procX, inputBM, &dst, width, srcBounds); |
| 638 } else if (height > 0) { | 637 } else if (height > 0) { |
| 639 call_proc_Y(procY, | 638 call_proc_Y(procY, |
| 640 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), | 639 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), |
| 641 inputBM.rowBytesAsPixels(), | 640 inputBM.rowBytesAsPixels(), |
| 642 &dst, height, srcBounds); | 641 &dst, height, srcBounds); |
| 643 } | 642 } |
| 644 offset->fX = bounds.left(); | 643 offset->fX = bounds.left(); |
| 645 offset->fY = bounds.top(); | 644 offset->fY = bounds.top(); |
| 646 | 645 |
| 647 return SkSpecialImage::MakeFromRaster(source->internal_getProxy(), | 646 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds
.height()), |
| 648 SkIRect::MakeWH(bounds.width(), bounds
.height()), | |
| 649 dst, &source->props()); | 647 dst, &source->props()); |
| 650 } | 648 } |
| OLD | NEW |