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

Side by Side Diff: src/effects/SkMagnifierImageFilter.cpp

Issue 654273002: Push isEqual/onIsEqual down from GrProcessor to subclasses. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « src/effects/SkLumaColorFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMagnifierImageFilter.h" 9 #include "SkMagnifierImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 float xInvInset, 65 float xInvInset,
66 float yInvInset) 66 float yInvInset)
67 : GrSingleTextureEffect(texture, GrCoordTransform::MakeDivByTextureWHMat rix(texture)) 67 : GrSingleTextureEffect(texture, GrCoordTransform::MakeDivByTextureWHMat rix(texture))
68 , fXOffset(xOffset) 68 , fXOffset(xOffset)
69 , fYOffset(yOffset) 69 , fYOffset(yOffset)
70 , fXInvZoom(xInvZoom) 70 , fXInvZoom(xInvZoom)
71 , fYInvZoom(yInvZoom) 71 , fYInvZoom(yInvZoom)
72 , fXInvInset(xInvInset) 72 , fXInvInset(xInvInset)
73 , fYInvInset(yInvInset) {} 73 , fYInvInset(yInvInset) {}
74 74
75 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; 75 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE;
76 76
77 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE; 77 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE;
78 78
79 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 79 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
80 80
81 float fXOffset; 81 float fXOffset;
82 float fYOffset; 82 float fYOffset;
83 float fXInvZoom; 83 float fXInvZoom;
84 float fYInvZoom; 84 float fYInvZoom;
85 float fXInvInset; 85 float fXInvInset;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 SkASSERT(effect); 209 SkASSERT(effect);
210 return effect; 210 return effect;
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 GrProcessor& 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->texture(0) == s.texture(0) &&
222 this->fXOffset == s.fXOffset && 222 this->fXOffset == s.fXOffset &&
223 this->fYOffset == s.fYOffset && 223 this->fYOffset == s.fYOffset &&
224 this->fXInvZoom == s.fXInvZoom && 224 this->fXInvZoom == s.fXInvZoom &&
225 this->fYInvZoom == s.fYInvZoom && 225 this->fYInvZoom == s.fYInvZoom &&
226 this->fXInvInset == s.fXInvInset && 226 this->fXInvInset == s.fXInvInset &&
227 this->fYInvInset == s.fYInvInset); 227 this->fYInvInset == s.fYInvInset);
228 } 228 }
229 229
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 365
366 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); 366 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1);
367 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); 367 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1);
368 368
369 *dptr = sptr[y_val * width + x_val]; 369 *dptr = sptr[y_val * width + x_val];
370 dptr++; 370 dptr++;
371 } 371 }
372 } 372 }
373 return true; 373 return true;
374 } 374 }
OLDNEW
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698