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

Side by Side Diff: src/gpu/effects/GrDitherEffect.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/gpu/effects/GrDistanceFieldTextureEffect.h ('k') | src/gpu/effects/GrOvalEffect.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 2014 Google Inc. 2 * Copyright 2014 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 "GrDitherEffect.h" 8 #include "GrDitherEffect.h"
9 9
10 #include "gl/GrGLEffect.h" 10 #include "gl/GrGLEffect.h"
11 #include "gl/GrGLSL.h" 11 #include "gl/GrGLSL.h"
12 #include "GrTBackendEffectFactory.h" 12 #include "GrTBackendEffectFactory.h"
13 13
14 #include "SkRect.h" 14 #include "SkRect.h"
15 15
16 ////////////////////////////////////////////////////////////////////////////// 16 //////////////////////////////////////////////////////////////////////////////
17 17
18 class GLDitherEffect; 18 class GLDitherEffect;
19 19
20 class DitherEffect : public GrEffect { 20 class DitherEffect : public GrEffect {
21 public: 21 public:
22 static GrEffectRef* Create() { 22 static GrEffectRef* Create() {
23 return CreateEffectRef(AutoEffectUnref(SkNEW(DitherEffect))); 23 GR_CREATE_STATIC_EFFECT(gDitherEffect, DitherEffect, ())
24 return SkRef(gDitherEffect);
24 } 25 }
25 26
26 virtual ~DitherEffect() {}; 27 virtual ~DitherEffect() {};
27 static const char* Name() { return "Dither"; } 28 static const char* Name() { return "Dither"; }
28 29
29 typedef GLDitherEffect GLEffect; 30 typedef GLDitherEffect GLEffect;
30 31
31 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE; 32 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags ) const SK_OVERRIDE;
32 33
33 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE { 34 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 builder->fragmentPosition()); 107 builder->fragmentPosition());
107 builder->fsCodeAppendf("\t\t%s = (1.0/255.0) * vec4(r, r, r, r) + %s;\n", 108 builder->fsCodeAppendf("\t\t%s = (1.0/255.0) * vec4(r, r, r, r) + %s;\n",
108 outputColor, GrGLSLExpr4(inputColor).c_str()); 109 outputColor, GrGLSLExpr4(inputColor).c_str());
109 } 110 }
110 111
111 ////////////////////////////////////////////////////////////////////////////// 112 //////////////////////////////////////////////////////////////////////////////
112 113
113 GrEffectRef* GrDitherEffect::Create() { 114 GrEffectRef* GrDitherEffect::Create() {
114 return DitherEffect::Create(); 115 return DitherEffect::Create();
115 } 116 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldTextureEffect.h ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698