OLD | NEW |
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 "SkLumaColorFilter.h" | 8 #include "SkLumaColorFilter.h" |
9 | 9 |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #ifndef SK_IGNORE_TO_STRING | 48 #ifndef SK_IGNORE_TO_STRING |
49 void SkLumaColorFilter::toString(SkString* str) const { | 49 void SkLumaColorFilter::toString(SkString* str) const { |
50 str->append("SkLumaColorFilter "); | 50 str->append("SkLumaColorFilter "); |
51 } | 51 } |
52 #endif | 52 #endif |
53 | 53 |
54 #if SK_SUPPORT_GPU | 54 #if SK_SUPPORT_GPU |
55 class LumaColorFilterEffect : public GrFragmentProcessor { | 55 class LumaColorFilterEffect : public GrFragmentProcessor { |
56 public: | 56 public: |
57 static const GrFragmentProcessor* Create() { | 57 static const GrFragmentProcessor* Create() { |
58 static LumaColorFilterEffect gLumaEffect; | 58 return new LumaColorFilterEffect; |
59 return SkRef(&gLumaEffect); | |
60 } | 59 } |
61 | 60 |
62 const char* name() const override { return "Luminance-to-Alpha"; } | 61 const char* name() const override { return "Luminance-to-Alpha"; } |
63 | 62 |
64 class GLProcessor : public GrGLFragmentProcessor { | 63 class GLProcessor : public GrGLFragmentProcessor { |
65 public: | 64 public: |
66 GLProcessor(const GrProcessor&) {} | 65 GLProcessor(const GrProcessor&) {} |
67 | 66 |
68 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKey
Builder* b) {} | 67 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKey
Builder* b) {} |
69 | 68 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
), | 105 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
), |
107 GrInvariantOutput::kWill_ReadInput); | 106 GrInvariantOutput::kWill_ReadInput); |
108 } | 107 } |
109 }; | 108 }; |
110 | 109 |
111 const GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) co
nst { | 110 const GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) co
nst { |
112 | 111 |
113 return LumaColorFilterEffect::Create(); | 112 return LumaColorFilterEffect::Create(); |
114 } | 113 } |
115 #endif | 114 #endif |
OLD | NEW |