OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #ifndef GrColorProcessor_DEFINED | 8 #ifndef GrColorProcessor_DEFINED |
9 #define GrColorProcessor_DEFINED | 9 #define GrColorProcessor_DEFINED |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 kLastInputMode = kModulateA_InputMode | 25 kLastInputMode = kModulateA_InputMode |
26 }; | 26 }; |
27 static const int kInputModeCnt = kLastInputMode + 1; | 27 static const int kInputModeCnt = kLastInputMode + 1; |
28 | 28 |
29 static GrFragmentProcessor* Create(GrColor color, InputMode mode) { | 29 static GrFragmentProcessor* Create(GrColor color, InputMode mode) { |
30 return new GrConstColorProcessor(color, mode); | 30 return new GrConstColorProcessor(color, mode); |
31 } | 31 } |
32 | 32 |
33 const char* name() const override { return "Color"; } | 33 const char* name() const override { return "Color"; } |
34 | 34 |
| 35 SkString dumpInfo() const override { |
| 36 SkString str; |
| 37 str.appendf("Color: 0x%08x", fColor); |
| 38 return str; |
| 39 } |
| 40 |
35 GrColor color() const { return fColor; } | 41 GrColor color() const { return fColor; } |
36 | 42 |
37 InputMode inputMode() const { return fMode; } | 43 InputMode inputMode() const { return fMode; } |
38 | 44 |
39 private: | 45 private: |
40 GrConstColorProcessor(GrColor color, InputMode mode) : fColor(color), fMode(
mode) { | 46 GrConstColorProcessor(GrColor color, InputMode mode) : fColor(color), fMode(
mode) { |
41 this->initClassID<GrConstColorProcessor>(); | 47 this->initClassID<GrConstColorProcessor>(); |
42 } | 48 } |
43 | 49 |
44 GrGLFragmentProcessor* onCreateGLInstance() const override; | 50 GrGLFragmentProcessor* onCreateGLInstance() const override; |
45 | 51 |
46 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov
erride; | 52 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov
erride; |
47 | 53 |
48 bool onIsEqual(const GrFragmentProcessor&) const override; | 54 bool onIsEqual(const GrFragmentProcessor&) const override; |
49 | 55 |
50 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 56 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
51 | 57 |
52 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 58 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
53 | 59 |
54 GrColor fColor; | 60 GrColor fColor; |
55 InputMode fMode; | 61 InputMode fMode; |
56 | 62 |
57 typedef GrFragmentProcessor INHERITED; | 63 typedef GrFragmentProcessor INHERITED; |
58 }; | 64 }; |
59 | 65 |
60 #endif | 66 #endif |
OLD | NEW |