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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkMagnifierImageFilter.h" | 9 #include "SkMagnifierImageFilter.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 211 } |
212 | 212 |
213 /////////////////////////////////////////////////////////////////////////////// | 213 /////////////////////////////////////////////////////////////////////////////// |
214 | 214 |
215 const GrBackendFragmentProcessorFactory& GrMagnifierEffect::getFactory() const { | 215 const GrBackendFragmentProcessorFactory& GrMagnifierEffect::getFactory() const { |
216 return GrTBackendFragmentProcessorFactory<GrMagnifierEffect>::getInstance(); | 216 return GrTBackendFragmentProcessorFactory<GrMagnifierEffect>::getInstance(); |
217 } | 217 } |
218 | 218 |
219 bool GrMagnifierEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 219 bool GrMagnifierEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
220 const GrMagnifierEffect& s = sBase.cast<GrMagnifierEffect>(); | 220 const GrMagnifierEffect& s = sBase.cast<GrMagnifierEffect>(); |
221 return (this->texture(0) == s.texture(0) && | 221 return (this->fXOffset == s.fXOffset && |
222 this->fXOffset == s.fXOffset && | |
223 this->fYOffset == s.fYOffset && | 222 this->fYOffset == s.fYOffset && |
224 this->fXInvZoom == s.fXInvZoom && | 223 this->fXInvZoom == s.fXInvZoom && |
225 this->fYInvZoom == s.fYInvZoom && | 224 this->fYInvZoom == s.fYInvZoom && |
226 this->fXInvInset == s.fXInvInset && | 225 this->fXInvInset == s.fXInvInset && |
227 this->fYInvInset == s.fYInvInset); | 226 this->fYInvInset == s.fYInvInset); |
228 } | 227 } |
229 | 228 |
230 void GrMagnifierEffect::onComputeInvariantOutput(InvariantOutput* inout) const { | 229 void GrMagnifierEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
231 this->updateInvariantOutputForModulation(inout); | 230 this->updateInvariantOutputForModulation(inout); |
232 } | 231 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 364 |
366 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); | 365 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); |
367 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); | 366 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); |
368 | 367 |
369 *dptr = sptr[y_val * width + x_val]; | 368 *dptr = sptr[y_val * width + x_val]; |
370 dptr++; | 369 dptr++; |
371 } | 370 } |
372 } | 371 } |
373 return true; | 372 return true; |
374 } | 373 } |
OLD | NEW |