OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 "SkColorFilter.h" | 8 #include "SkColorFilter.h" |
9 #include "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
10 #include "SkRefCnt.h" | 10 #include "SkRefCnt.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #ifndef SK_IGNORE_TO_STRING | 62 #ifndef SK_IGNORE_TO_STRING |
63 void toString(SkString* str) const override { | 63 void toString(SkString* str) const override { |
64 SkString outerS, innerS; | 64 SkString outerS, innerS; |
65 fOuter->toString(&outerS); | 65 fOuter->toString(&outerS); |
66 fInner->toString(&innerS); | 66 fInner->toString(&innerS); |
67 str->appendf("SkComposeColorFilter: outer(%s) inner(%s)", outerS.c_str()
, innerS.c_str()); | 67 str->appendf("SkComposeColorFilter: outer(%s) inner(%s)", outerS.c_str()
, innerS.c_str()); |
68 } | 68 } |
69 #endif | 69 #endif |
70 | 70 |
71 #if SK_SUPPORT_GPU | 71 #if SK_SUPPORT_GPU |
72 const GrFragmentProcessor* asFragmentProcessor(GrContext* context, | 72 const GrFragmentProcessor* asFragmentProcessor(GrContext* context) const ove
rride { |
73 GrProcessorDataManager* pdm)
const override { | 73 SkAutoTUnref<const GrFragmentProcessor> innerFP(fInner->asFragmentProces
sor(context)); |
74 SkAutoTUnref<const GrFragmentProcessor> innerFP(fInner->asFragmentProces
sor(context, pdm)); | 74 SkAutoTUnref<const GrFragmentProcessor> outerFP(fOuter->asFragmentProces
sor(context)); |
75 SkAutoTUnref<const GrFragmentProcessor> outerFP(fOuter->asFragmentProces
sor(context, pdm)); | |
76 if (!innerFP || !outerFP) { | 75 if (!innerFP || !outerFP) { |
77 return nullptr; | 76 return nullptr; |
78 } | 77 } |
79 const GrFragmentProcessor* series[] = { innerFP, outerFP }; | 78 const GrFragmentProcessor* series[] = { innerFP, outerFP }; |
80 return GrFragmentProcessor::RunInSeries(series, 2); | 79 return GrFragmentProcessor::RunInSeries(series, 2); |
81 } | 80 } |
82 #endif | 81 #endif |
83 | 82 |
84 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeColorFilter) | 83 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeColorFilter) |
85 | 84 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 if (count > SK_MAX_COMPOSE_COLORFILTER_COUNT) { | 137 if (count > SK_MAX_COMPOSE_COLORFILTER_COUNT) { |
139 return nullptr; | 138 return nullptr; |
140 } | 139 } |
141 return new SkComposeColorFilter(outer, inner, count); | 140 return new SkComposeColorFilter(outer, inner, count); |
142 } | 141 } |
143 | 142 |
144 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) | 143 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) |
145 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeColorFilter) | 144 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeColorFilter) |
146 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 145 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
147 | 146 |
OLD | NEW |