• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016 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 
8 #ifndef SkBlendModePriv_DEFINED
9 #define SkBlendModePriv_DEFINED
10 
11 #include "include/core/SkBlendMode.h"
12 #include "include/core/SkColor.h"
13 #include "include/private/SkColorData.h"
14 
15 class SkRasterPipeline;
16 
17 /**
18  *  Sentinel value for SkBlendMode enum.
19  *
20  *  Will never be a valid enum value, but will be storable in a byte.
21  */
22 constexpr uint8_t kCustom_SkBlendMode = 0xFF;
23 
24 bool SkBlendMode_SupportsCoverageAsAlpha(SkBlendMode);
25 
SkBlendMode_CaresAboutRBOrder(SkBlendMode mode)26 static inline bool SkBlendMode_CaresAboutRBOrder(SkBlendMode mode) {
27     return (mode > SkBlendMode::kLastSeparableMode);
28 }
29 
30 bool SkBlendMode_ShouldPreScaleCoverage(SkBlendMode, bool rgb_coverage);
31 void SkBlendMode_AppendStages(SkBlendMode, SkRasterPipeline*);
32 
33 SkPMColor4f SkBlendMode_Apply(SkBlendMode, const SkPMColor4f& src, const SkPMColor4f& dst);
34 
35 #if SK_SUPPORT_GPU
36 #include "src/gpu/GrXferProcessor.h"
37 const GrXPFactory* SkBlendMode_AsXPFactory(SkBlendMode);
38 #endif
39 
40 #endif
41