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

Side by Side Diff: src/gpu/effects/GrDitherEffect.cpp

Issue 1414733007: Stop creating static GrProcessor instances (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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') | tests/GLProgramsTest.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 #include "GrFragmentProcessor.h" 9 #include "GrFragmentProcessor.h"
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
11 #include "SkRect.h" 11 #include "SkRect.h"
12 #include "gl/GrGLFragmentProcessor.h" 12 #include "gl/GrGLFragmentProcessor.h"
13 #include "gl/builders/GrGLProgramBuilder.h" 13 #include "gl/builders/GrGLProgramBuilder.h"
14 14
15 ////////////////////////////////////////////////////////////////////////////// 15 //////////////////////////////////////////////////////////////////////////////
16 16
17 class DitherEffect : public GrFragmentProcessor { 17 class DitherEffect : public GrFragmentProcessor {
18 public: 18 public:
19 static GrFragmentProcessor* Create() { 19 static GrFragmentProcessor* Create() {
20 static DitherEffect gDitherEffect; 20 return new DitherEffect;
21 return SkRef(&gDitherEffect);
22 } 21 }
23 22
24 virtual ~DitherEffect() {}; 23 virtual ~DitherEffect() {};
25 24
26 const char* name() const override { return "Dither"; } 25 const char* name() const override { return "Dither"; }
27 26
28 private: 27 private:
29 DitherEffect() { 28 DitherEffect() {
30 this->initClassID<DitherEffect>(); 29 this->initClassID<DitherEffect>();
31 this->setWillReadFragmentPosition(); 30 this->setWillReadFragmentPosition();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void DitherEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, 94 void DitherEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
96 GrProcessorKeyBuilder* b) const { 95 GrProcessorKeyBuilder* b) const {
97 GLDitherEffect::GenKey(*this, caps, b); 96 GLDitherEffect::GenKey(*this, caps, b);
98 } 97 }
99 98
100 GrGLFragmentProcessor* DitherEffect::onCreateGLInstance() const { 99 GrGLFragmentProcessor* DitherEffect::onCreateGLInstance() const {
101 return new GLDitherEffect(*this); 100 return new GLDitherEffect(*this);
102 } 101 }
103 102
104 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); } 103 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); }
OLDNEW
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698