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 "SkBlitRow.h" | 8 #include "SkBlitRow.h" |
9 #include "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 SkXfermode::Coeff dstCoeff; | 279 SkXfermode::Coeff dstCoeff; |
280 SkXfermode::Coeff srcCoeff; | 280 SkXfermode::Coeff srcCoeff; |
281 SkAssertResult(SkXfermode::ModeAsCoeff(fMode, &srcCoeff, &dstCoeff)); | 281 SkAssertResult(SkXfermode::ModeAsCoeff(fMode, &srcCoeff, &dstCoeff)); |
282 // These could be calculated from the blend equation with template trick
ery.. | 282 // These could be calculated from the blend equation with template trick
ery.. |
283 if (SkXfermode::kZero_Coeff == dstCoeff && | 283 if (SkXfermode::kZero_Coeff == dstCoeff && |
284 !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) { | 284 !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) { |
285 this->setWillNotUseInputColor(); | 285 this->setWillNotUseInputColor(); |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { | 289 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE { |
290 const ModeColorFilterEffect& s = other.cast<ModeColorFilterEffect>(); | 290 const ModeColorFilterEffect& s = other.cast<ModeColorFilterEffect>(); |
291 return fMode == s.fMode && fColor == s.fColor; | 291 return fMode == s.fMode && fColor == s.fColor; |
292 } | 292 } |
293 | 293 |
294 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; | 294 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; |
295 | 295 |
296 SkXfermode::Mode fMode; | 296 SkXfermode::Mode fMode; |
297 GrColor fColor; | 297 GrColor fColor; |
298 | 298 |
299 typedef GrFragmentProcessor INHERITED; | 299 typedef GrFragmentProcessor INHERITED; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), | 550 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), |
551 SkIntToScalar(SkColorGetG(add)), | 551 SkIntToScalar(SkColorGetG(add)), |
552 SkIntToScalar(SkColorGetB(add)), | 552 SkIntToScalar(SkColorGetB(add)), |
553 0); | 553 0); |
554 return SkColorMatrixFilter::Create(matrix); | 554 return SkColorMatrixFilter::Create(matrix); |
555 } | 555 } |
556 | 556 |
557 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) | 557 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) |
558 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter) | 558 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter) |
559 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 559 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |