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

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

Issue 15995026: Image filters: implement offsets in GPU path. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Wrap lines at 100 chars. Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « include/effects/SkXfermodeImageFilter.h ('k') | src/core/SkImageFilterUtils.cpp » ('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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&, 92 bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&,
93 SkBitmap*, SkIPoint*) { 93 SkBitmap*, SkIPoint*) {
94 return false; 94 return false;
95 } 95 }
96 96
97 bool SkImageFilter::canFilterImageGPU() const { 97 bool SkImageFilter::canFilterImageGPU() const {
98 return this->asNewEffect(NULL, NULL); 98 return this->asNewEffect(NULL, NULL);
99 } 99 }
100 100
101 bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitmap* result) { 101 bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitmap* result,
102 SkIPoint* offset) {
102 #if SK_SUPPORT_GPU 103 #if SK_SUPPORT_GPU
103 SkBitmap input; 104 SkBitmap input;
104 SkASSERT(fInputCount == 1); 105 SkASSERT(fInputCount == 1);
105 if (!SkImageFilterUtils::GetInputResultGPU(this->getInput(0), proxy, src, &i nput)) { 106 if (!SkImageFilterUtils::GetInputResultGPU(this->getInput(0), proxy, src, &i nput, offset)) {
106 return false; 107 return false;
107 } 108 }
108 GrTexture* srcTexture = input.getTexture(); 109 GrTexture* srcTexture = input.getTexture();
109 SkRect rect; 110 SkRect rect;
110 src.getBounds(&rect); 111 src.getBounds(&rect);
111 GrContext* context = srcTexture->getContext(); 112 GrContext* context = srcTexture->getContext();
112 113
113 GrTextureDesc desc; 114 GrTextureDesc desc;
114 desc.fFlags = kRenderTarget_GrTextureFlagBit, 115 desc.fFlags = kRenderTarget_GrTextureFlagBit,
115 desc.fWidth = input.width(); 116 desc.fWidth = input.width();
(...skipping 26 matching lines...) Expand all
142 return true; 143 return true;
143 } 144 }
144 145
145 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*) const { 146 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*) const {
146 return false; 147 return false;
147 } 148 }
148 149
149 bool SkImageFilter::asColorFilter(SkColorFilter**) const { 150 bool SkImageFilter::asColorFilter(SkColorFilter**) const {
150 return false; 151 return false;
151 } 152 }
OLDNEW
« no previous file with comments | « include/effects/SkXfermodeImageFilter.h ('k') | src/core/SkImageFilterUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698