Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: src/core/SkImageFilter.cpp

Issue 1861643003: Upgrade SkSpecialImage to have getTextureRef & getROPixels entry points (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkPixelRef.h ('k') | src/core/SkSpecialImage.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « include/core/SkPixelRef.h ('k') | src/core/SkSpecialImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698