OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrPorterDuffXferProcessor_DEFINED | 8 #ifndef GrPorterDuffXferProcessor_DEFINED |
9 #define GrPorterDuffXferProcessor_DEFINED | 9 #define GrPorterDuffXferProcessor_DEFINED |
10 | 10 |
11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
12 #include "GrXferProcessor.h" | 12 #include "GrXferProcessor.h" |
13 #include "SkXfermode.h" | 13 #include "SkXfermode.h" |
14 | 14 |
15 class GrProcOptInfo; | 15 class GrProcOptInfo; |
16 | 16 |
17 class GrPorterDuffXPFactory : public GrXPFactory { | 17 class GrPorterDuffXPFactory : public GrXPFactory { |
18 public: | 18 public: |
19 static sk_sp<GrXPFactory> Make(SkXfermode::Mode mode); | 19 static sk_sp<GrXPFactory> Make(SkXfermode::Mode mode); |
| 20 static sk_sp<GrXPFactory> Make(SkBlendMode mode) { |
| 21 return Make((SkXfermode::Mode)mode); |
| 22 } |
20 | 23 |
21 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, | 24 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
22 GrXPFactory::InvariantBlendedColor*) const ove
rride; | 25 GrXPFactory::InvariantBlendedColor*) const ove
rride; |
23 | 26 |
24 | 27 |
25 /** Because src-over is so common we special case it for performance reasons
. If this returns | 28 /** Because src-over is so common we special case it for performance reasons
. If this returns |
26 null then the SimpleSrcOverXP() below should be used. */ | 29 null then the SimpleSrcOverXP() below should be used. */ |
27 static GrXferProcessor* CreateSrcOverXferProcessor(const GrCaps& caps, | 30 static GrXferProcessor* CreateSrcOverXferProcessor(const GrCaps& caps, |
28 const GrPipelineOptimizat
ions& optimizations, | 31 const GrPipelineOptimizat
ions& optimizations, |
29 bool hasMixedSamples, | 32 bool hasMixedSamples, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 GR_DECLARE_XP_FACTORY_TEST; | 71 GR_DECLARE_XP_FACTORY_TEST; |
69 static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, in
t* outSecondary); | 72 static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, in
t* outSecondary); |
70 | 73 |
71 SkXfermode::Mode fXfermode; | 74 SkXfermode::Mode fXfermode; |
72 | 75 |
73 friend class GrPorterDuffTest; // for TestGetXPOutputTypes() | 76 friend class GrPorterDuffTest; // for TestGetXPOutputTypes() |
74 typedef GrXPFactory INHERITED; | 77 typedef GrXPFactory INHERITED; |
75 }; | 78 }; |
76 | 79 |
77 #endif | 80 #endif |
OLD | NEW |