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

Side by Side Diff: src/effects/SkAlphaThresholdFilter.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/core/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 class GrGLAlphaThresholdEffect; 54 class GrGLAlphaThresholdEffect;
55 55
56 class AlphaThresholdEffect : public GrEffect { 56 class AlphaThresholdEffect : public GrEffect {
57 57
58 public: 58 public:
59 static GrEffectRef* Create(GrTexture* texture, 59 static GrEffectRef* Create(GrTexture* texture,
60 GrTexture* maskTexture, 60 GrTexture* maskTexture,
61 float innerThreshold, 61 float innerThreshold,
62 float outerThreshold) { 62 float outerThreshold) {
63 AutoEffectUnref effect(SkNEW_ARGS(AlphaThresholdEffect, (texture, 63 return SkNEW_ARGS(AlphaThresholdEffect, (texture,
64 maskTexture, 64 maskTexture,
65 innerThreshold, 65 innerThreshold,
66 outerThreshold) )); 66 outerThreshold));
67 return CreateEffectRef(effect);
68 } 67 }
69 68
70 virtual ~AlphaThresholdEffect() {}; 69 virtual ~AlphaThresholdEffect() {};
71 70
72 static const char* Name() { return "Alpha Threshold"; } 71 static const char* Name() { return "Alpha Threshold"; }
73 72
74 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; 73 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
75 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE; 74 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE;
76 75
77 float innerThreshold() const { return fInnerThreshold; } 76 float innerThreshold() const { return fInnerThreshold; }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 (U8CPU)(SkColorGetG(source) * scale), 356 (U8CPU)(SkColorGetG(source) * scale),
358 (U8CPU)(SkColorGetB(source) * scale)); 357 (U8CPU)(SkColorGetB(source) * scale));
359 } 358 }
360 } 359 }
361 dptr[y * dst->width() + x] = output_color; 360 dptr[y * dst->width() + x] = output_color;
362 } 361 }
363 } 362 }
364 363
365 return true; 364 return true;
366 } 365 }
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698