SkCoverageMode.h 827 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright 2018 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SkCoverageMode_DEFINED
  8. #define SkCoverageMode_DEFINED
  9. #include "include/core/SkTypes.h"
  10. /**
  11. * Describes geometric operations (ala SkRegion::Op) that can be applied to coverage bytes.
  12. * These can be thought of as variants of porter-duff (SkBlendMode) modes, but only applied
  13. * to the alpha channel.
  14. *
  15. * See SkMaskFilter for ways to use these when combining two different masks.
  16. */
  17. enum class SkCoverageMode {
  18. kUnion, // A ∪ B A+B-A*B
  19. kIntersect, // A ∩ B A*B
  20. kDifference, // A - B A*(1-B)
  21. kReverseDifference, // B - A B*(1-A)
  22. kXor, // A ⊕ B A+B-2*A*B
  23. kLast = kXor,
  24. };
  25. #endif