| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 SkBitmap* dst) { | 650 SkBitmap* dst) { |
| 651 SkAutoTUnref<GrTexture> srcTexture(SkRef(input.getTexture())); | 651 SkAutoTUnref<GrTexture> srcTexture(SkRef(input.getTexture())); |
| 652 SkASSERT(srcTexture); | 652 SkASSERT(srcTexture); |
| 653 GrContext* context = srcTexture->getContext(); | 653 GrContext* context = srcTexture->getContext(); |
| 654 | 654 |
| 655 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi
dth()), | 655 GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->wi
dth()), |
| 656 SkIntToScalar(srcTexture->he
ight()))); | 656 SkIntToScalar(srcTexture->he
ight()))); |
| 657 | 657 |
| 658 SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height()); | 658 SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height()); |
| 659 GrSurfaceDesc desc; | 659 GrSurfaceDesc desc; |
| 660 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; | 660 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 661 desc.fWidth = rect.width(); | 661 desc.fWidth = rect.width(); |
| 662 desc.fHeight = rect.height(); | 662 desc.fHeight = rect.height(); |
| 663 desc.fConfig = kSkia8888_GrPixelConfig; | 663 desc.fConfig = kSkia8888_GrPixelConfig; |
| 664 SkIRect srcRect = rect; | 664 SkIRect srcRect = rect; |
| 665 | 665 |
| 666 if (radius.fWidth > 0) { | 666 if (radius.fWidth > 0) { |
| 667 GrTexture* texture = context->refScratchTexture(desc, GrContext::kApprox
_ScratchTexMatch); | 667 GrTexture* texture = context->refScratchTexture(desc, GrContext::kApprox
_ScratchTexMatch); |
| 668 if (NULL == texture) { | 668 if (NULL == texture) { |
| 669 return false; | 669 return false; |
| 670 } | 670 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 SkBitmap* result, SkIPoint* offset) con
st { | 742 SkBitmap* result, SkIPoint* offset) con
st { |
| 743 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); | 743 return this->filterImageGPUGeneric(true, proxy, src, ctx, result, offset); |
| 744 } | 744 } |
| 745 | 745 |
| 746 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 746 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 747 SkBitmap* result, SkIPoint* offset) cons
t { | 747 SkBitmap* result, SkIPoint* offset) cons
t { |
| 748 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); | 748 return this->filterImageGPUGeneric(false, proxy, src, ctx, result, offset); |
| 749 } | 749 } |
| 750 | 750 |
| 751 #endif | 751 #endif |
| OLD | NEW |