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

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

Issue 371103003: Remove GrEffect::CreateEffectRef and GrEffect::AutoEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@no_ref2
Patch Set: Address comments and update for new YUV effect Created 6 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
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.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 14 matching lines...) Expand all
25 class GrMagnifierEffect : public GrSingleTextureEffect { 25 class GrMagnifierEffect : public GrSingleTextureEffect {
26 26
27 public: 27 public:
28 static GrEffectRef* Create(GrTexture* texture, 28 static GrEffectRef* Create(GrTexture* texture,
29 float xOffset, 29 float xOffset,
30 float yOffset, 30 float yOffset,
31 float xInvZoom, 31 float xInvZoom,
32 float yInvZoom, 32 float yInvZoom,
33 float xInvInset, 33 float xInvInset,
34 float yInvInset) { 34 float yInvInset) {
35 AutoEffectUnref effect(SkNEW_ARGS(GrMagnifierEffect, (texture, 35 return SkNEW_ARGS(GrMagnifierEffect, (texture,
36 xOffset, 36 xOffset,
37 yOffset, 37 yOffset,
38 xInvZoom, 38 xInvZoom,
39 yInvZoom, 39 yInvZoom,
40 xInvInset, 40 xInvInset,
41 yInvInset))); 41 yInvInset));
42 return CreateEffectRef(effect);
43 } 42 }
44 43
45 virtual ~GrMagnifierEffect() {}; 44 virtual ~GrMagnifierEffect() {};
46 45
47 static const char* Name() { return "Magnifier"; } 46 static const char* Name() { return "Magnifier"; }
48 47
49 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; 48 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
50 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE; 49 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE;
51 50
52 float x_offset() const { return fXOffset; } 51 float x_offset() const { return fXOffset; }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 340
342 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); 341 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1);
343 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); 342 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1);
344 343
345 *dptr = sptr[y_val * width + x_val]; 344 *dptr = sptr[y_val * width + x_val];
346 dptr++; 345 dptr++;
347 } 346 }
348 } 347 }
349 return true; 348 return true;
350 } 349 }
OLDNEW
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698