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 GrXPFactory* Create(SkXfermode::Mode mode); | 19 static sk_sp<GrXPFactory> Make(SkXfermode::Mode mode); |
20 | 20 |
21 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, | 21 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, |
22 GrXPFactory::InvariantBlendedColor*) const ove
rride; | 22 GrXPFactory::InvariantBlendedColor*) const ove
rride; |
23 | 23 |
24 | 24 |
25 /** Because src-over is so common we special case it for performance reasons
. If this returns | 25 /** 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. */ | 26 null then the SimpleSrcOverXP() below should be used. */ |
27 static GrXferProcessor* CreateSrcOverXferProcessor(const GrCaps& caps, | 27 static GrXferProcessor* CreateSrcOverXferProcessor(const GrCaps& caps, |
28 const GrPipelineOptimizat
ions& optimizations, | 28 const GrPipelineOptimizat
ions& optimizations, |
29 bool hasMixedSamples, | 29 bool hasMixedSamples, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 GR_DECLARE_XP_FACTORY_TEST; | 68 GR_DECLARE_XP_FACTORY_TEST; |
69 static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, in
t* outSecondary); | 69 static void TestGetXPOutputTypes(const GrXferProcessor*, int* outPrimary, in
t* outSecondary); |
70 | 70 |
71 SkXfermode::Mode fXfermode; | 71 SkXfermode::Mode fXfermode; |
72 | 72 |
73 friend class GrPorterDuffTest; // for TestGetXPOutputTypes() | 73 friend class GrPorterDuffTest; // for TestGetXPOutputTypes() |
74 typedef GrXPFactory INHERITED; | 74 typedef GrXPFactory INHERITED; |
75 }; | 75 }; |
76 | 76 |
77 #endif | 77 #endif |
OLD | NEW |