Chromium Code Reviews| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 511 if (!dstDrawContext) { | 511 if (!dstDrawContext) { |
| 512 return nullptr; | 512 return nullptr; |
| 513 } | 513 } |
| 514 | 514 |
| 515 apply_morphology_pass(dstDrawContext.get(), clip, srcTexture.get(), | 515 apply_morphology_pass(dstDrawContext.get(), clip, srcTexture.get(), |
| 516 srcRect, dstRect, radius.fHeight, morphType, | 516 srcRect, dstRect, radius.fHeight, morphType, |
| 517 Gr1DKernelEffect::kY_Direction); | 517 Gr1DKernelEffect::kY_Direction); |
| 518 | 518 |
| 519 srcTexture = dstDrawContext->asTexture(); | 519 srcTexture = dstDrawContext->asTexture(); |
| 520 } | 520 } |
| 521 | 521 |
|
robertphillips
2016/07/20 19:44:39
// TODO: ...
| |
| 522 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(rect.width(), rect.height ()), | 522 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(rect.width(), rect.height ()), |
| 523 kNeedNewImageUniqueID_SpecialImage, | 523 kNeedNewImageUniqueID_SpecialImage, |
| 524 std::move(srcTexture), &input->props()); | 524 std::move(srcTexture), sk_ref_sp(input->g etColorSpace()), |
| 525 &input->props()); | |
| 525 } | 526 } |
| 526 #endif | 527 #endif |
| 527 | 528 |
| 528 sk_sp<SkSpecialImage> SkMorphologyImageFilter::onFilterImage(SkSpecialImage* sou rce, | 529 sk_sp<SkSpecialImage> SkMorphologyImageFilter::onFilterImage(SkSpecialImage* sou rce, |
| 529 const Context& ctx, | 530 const Context& ctx, |
| 530 SkIPoint* offset) c onst { | 531 SkIPoint* offset) c onst { |
| 531 SkIPoint inputOffset = SkIPoint::Make(0, 0); | 532 SkIPoint inputOffset = SkIPoint::Make(0, 0); |
| 532 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset)) ; | 533 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset)) ; |
| 533 if (!input) { | 534 if (!input) { |
| 534 return nullptr; | 535 return nullptr; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 625 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), | 626 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), |
| 626 inputBM.rowBytesAsPixels(), | 627 inputBM.rowBytesAsPixels(), |
| 627 &dst, height, srcBounds); | 628 &dst, height, srcBounds); |
| 628 } | 629 } |
| 629 offset->fX = bounds.left(); | 630 offset->fX = bounds.left(); |
| 630 offset->fY = bounds.top(); | 631 offset->fY = bounds.top(); |
| 631 | 632 |
| 632 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds .height()), | 633 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds .height()), |
| 633 dst, &source->props()); | 634 dst, &source->props()); |
| 634 } | 635 } |
| OLD | NEW |