Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: include/gpu/effects/GrCoverageSetOpXP.h

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | include/gpu/effects/GrPorterDuffXferProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 GrCoverageSetOpXP_DEFINED 8 #ifndef GrCoverageSetOpXP_DEFINED
9 #define GrCoverageSetOpXP_DEFINED 9 #define GrCoverageSetOpXP_DEFINED
10 10
11 #include "GrTypes.h" 11 #include "GrTypes.h"
12 #include "GrXferProcessor.h" 12 #include "GrXferProcessor.h"
13 #include "SkRegion.h" 13 #include "SkRegion.h"
14 14
15 class GrProcOptInfo; 15 class GrProcOptInfo;
16 16
17 /** 17 /**
18 * This xfer processor directly blends the the src coverage with the dst using a set operator. It is 18 * This xfer processor directly blends the the src coverage with the dst using a set operator. It is
19 * useful for rendering coverage masks using CSG. It can optionally invert the s rc coverage before 19 * useful for rendering coverage masks using CSG. It can optionally invert the s rc coverage before
20 * applying the set operator. 20 * applying the set operator.
21 */ 21 */
22 class GrCoverageSetOpXPFactory : public GrXPFactory { 22 class GrCoverageSetOpXPFactory : public GrXPFactory {
23 public: 23 public:
24 static GrXPFactory* Create(SkRegion::Op regionOp, bool invertCoverage = fals e); 24 static GrXPFactory* Create(SkRegion::Op regionOp, bool invertCoverage = fals e);
25 25
26 bool supportsRGBCoverage(GrColor /*knownColor*/,
27 uint32_t /*knownColorFlags*/) const override {
28 return true;
29 }
30
31 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, 26 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
32 GrXPFactory::InvariantBlendedColor*) const ove rride; 27 GrXPFactory::InvariantBlendedColor*) const ove rride;
33 28
34 private: 29 private:
35 GrCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage); 30 GrCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage);
36 31
37 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, 32 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
38 const GrProcOptInfo& colorPOI, 33 const GrProcOptInfo& colorPOI,
39 const GrProcOptInfo& coveragePOI, 34 const GrProcOptInfo& coveragePOI,
40 bool hasMixedSamples, 35 bool hasMixedSamples,
(...skipping 13 matching lines...) Expand all
54 49
55 GR_DECLARE_XP_FACTORY_TEST; 50 GR_DECLARE_XP_FACTORY_TEST;
56 51
57 SkRegion::Op fRegionOp; 52 SkRegion::Op fRegionOp;
58 bool fInvertCoverage; 53 bool fInvertCoverage;
59 54
60 typedef GrXPFactory INHERITED; 55 typedef GrXPFactory INHERITED;
61 }; 56 };
62 #endif 57 #endif
63 58
OLDNEW
« no previous file with comments | « include/gpu/GrXferProcessor.h ('k') | include/gpu/effects/GrPorterDuffXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698