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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 #include "SkImageFilterCacheKey.h" | 9 #include "SkImageFilterCacheKey.h" |
10 | 10 |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 const Context& ctx, | 594 const Context& ctx, |
595 SkIPoint* offset) const { | 595 SkIPoint* offset) const { |
596 SkImageFilter* input = this->getInput(index); | 596 SkImageFilter* input = this->getInput(index); |
597 if (!input) { | 597 if (!input) { |
598 return sk_sp<SkSpecialImage>(SkRef(src)); | 598 return sk_sp<SkSpecialImage>(SkRef(src)); |
599 } | 599 } |
600 | 600 |
601 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx),
offset)); | 601 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx),
offset)); |
602 | 602 |
603 #if SK_SUPPORT_GPU | 603 #if SK_SUPPORT_GPU |
604 if (src->peekTexture() && result && !result->peekTexture()) { | 604 if (src->isTextureBacked() && result && !result->isTextureBacked()) { |
605 // Keep the result on the GPU - this is still required for some | 605 // Keep the result on the GPU - this is still required for some |
606 // image filters that don't support GPU in all cases | 606 // image filters that don't support GPU in all cases |
607 GrContext* context = src->peekTexture()->getContext(); | 607 GrContext* context = src->getContext(); |
608 return result->makeTextureImage(src->internal_getProxy(), context); | 608 return result->makeTextureImage(src->internal_getProxy(), context); |
609 } | 609 } |
610 #endif | 610 #endif |
611 | 611 |
612 return result; | 612 return result; |
613 } | 613 } |
614 | 614 |
615 #if SK_SUPPORT_GPU | 615 #if SK_SUPPORT_GPU |
616 | 616 |
617 bool SkImageFilter::filterInputGPUDeprecated(int index, SkImageFilter::Proxy* pr
oxy, | 617 bool SkImageFilter::filterInputGPUDeprecated(int index, SkImageFilter::Proxy* pr
oxy, |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 dev = SkBitmapDevice::Create(cinfo.fInfo, surfaceProps); | 824 dev = SkBitmapDevice::Create(cinfo.fInfo, surfaceProps); |
825 } | 825 } |
826 return dev; | 826 return dev; |
827 } | 827 } |
828 | 828 |
829 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, | 829 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, |
830 const SkImageFilter::Context& ctx, | 830 const SkImageFilter::Context& ctx, |
831 SkBitmap* result, SkIPoint* offset) { | 831 SkBitmap* result, SkIPoint* offset) { |
832 return fDevice->filterImage(filter, src, ctx, result, offset); | 832 return fDevice->filterImage(filter, src, ctx, result, offset); |
833 } | 833 } |
OLD | NEW |