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 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |