| 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 26 matching lines...) Expand all Loading... |
| 37 dst[i] = SkPackARGB32(luma, 0, 0, 0); | 37 dst[i] = SkPackARGB32(luma, 0, 0, 0); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 SkColorFilter* SkLumaColorFilter::Create() { | 41 SkColorFilter* SkLumaColorFilter::Create() { |
| 42 return SkNEW(SkLumaColorFilter); | 42 return SkNEW(SkLumaColorFilter); |
| 43 } | 43 } |
| 44 | 44 |
| 45 SkLumaColorFilter::SkLumaColorFilter() : INHERITED() {} | 45 SkLumaColorFilter::SkLumaColorFilter() : INHERITED() {} |
| 46 | 46 |
| 47 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
| 48 SkLumaColorFilter::SkLumaColorFilter(SkReadBuffer& buffer) : INHERITED(buffer) {
} |
| 49 #endif |
| 50 |
| 47 SkFlattenable* SkLumaColorFilter::CreateProc(SkReadBuffer&) { | 51 SkFlattenable* SkLumaColorFilter::CreateProc(SkReadBuffer&) { |
| 48 return SkNEW(SkLumaColorFilter); | 52 return SkNEW(SkLumaColorFilter); |
| 49 } | 53 } |
| 50 | 54 |
| 51 void SkLumaColorFilter::flatten(SkWriteBuffer&) const {} | 55 void SkLumaColorFilter::flatten(SkWriteBuffer&) const {} |
| 52 | 56 |
| 53 #ifndef SK_IGNORE_TO_STRING | 57 #ifndef SK_IGNORE_TO_STRING |
| 54 void SkLumaColorFilter::toString(SkString* str) const { | 58 void SkLumaColorFilter::toString(SkString* str) const { |
| 55 str->append("SkLumaColorFilter "); | 59 str->append("SkLumaColorFilter "); |
| 56 } | 60 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // The output is always black. The alpha value for the color passed in i
s arbitrary. | 115 // The output is always black. The alpha value for the color passed in i
s arbitrary. |
| 112 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
), | 116 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
), |
| 113 GrInvariantOutput::kWill_ReadInput); | 117 GrInvariantOutput::kWill_ReadInput); |
| 114 } | 118 } |
| 115 }; | 119 }; |
| 116 | 120 |
| 117 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const { | 121 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const { |
| 118 return LumaColorFilterEffect::Create(); | 122 return LumaColorFilterEffect::Create(); |
| 119 } | 123 } |
| 120 #endif | 124 #endif |
| OLD | NEW |