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

Side by Side Diff: include/gpu/GrPaint.h

Issue 926593005: Use SkXfermode as public facing enum for GrPorterDuffXP (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Review fixes Created 5 years, 10 months 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 | « gyp/gpu.gypi ('k') | include/gpu/GrTypes.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef GrPaint_DEFINED 10 #ifndef GrPaint_DEFINED
11 #define GrPaint_DEFINED 11 #define GrPaint_DEFINED
12 12
13 #include "GrColor.h" 13 #include "GrColor.h"
14 #include "GrFragmentStage.h" 14 #include "GrFragmentStage.h"
15 #include "GrXferProcessor.h" 15 #include "GrXferProcessor.h"
16 #include "effects/GrPorterDuffXferProcessor.h" 16 #include "effects/GrPorterDuffXferProcessor.h"
17 17
18 #include "SkRegion.h"
18 #include "SkXfermode.h" 19 #include "SkXfermode.h"
19 20
20 /** 21 /**
21 * The paint describes how color and coverage are computed at each pixel by GrCo ntext draw 22 * The paint describes how color and coverage are computed at each pixel by GrCo ntext draw
22 * functions and the how color is blended with the destination pixel. 23 * functions and the how color is blended with the destination pixel.
23 * 24 *
24 * The paint allows installation of custom color and coverage stages. New types of stages are 25 * The paint allows installation of custom color and coverage stages. New types of stages are
25 * created by subclassing GrProcessor. 26 * created by subclassing GrProcessor.
26 * 27 *
27 * The primitive color computation starts with the color specified by setColor() . This color is the 28 * The primitive color computation starts with the color specified by setColor() . This color is the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 64
64 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) { 65 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) {
65 fXPFactory.reset(SkRef(xpFactory)); 66 fXPFactory.reset(SkRef(xpFactory));
66 return xpFactory; 67 return xpFactory;
67 } 68 }
68 69
69 void setPorterDuffXPFactory(SkXfermode::Mode mode) { 70 void setPorterDuffXPFactory(SkXfermode::Mode mode) {
70 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode)); 71 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode));
71 } 72 }
72 73
73 void setPorterDuffXPFactory(GrBlendCoeff src, GrBlendCoeff dst) { 74 void setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage = false);
74 fXPFactory.reset(GrPorterDuffXPFactory::Create(src, dst));
75 }
76 75
77 /** 76 /**
78 * Appends an additional color processor to the color computation. 77 * Appends an additional color processor to the color computation.
79 */ 78 */
80 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* fp) { 79 const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* fp) {
81 SkASSERT(fp); 80 SkASSERT(fp);
82 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (fp)); 81 SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (fp));
83 return fp; 82 return fp;
84 } 83 }
85 84
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 SkSTArray<4, GrFragmentStage> fColorStages; 139 SkSTArray<4, GrFragmentStage> fColorStages;
141 SkSTArray<2, GrFragmentStage> fCoverageStages; 140 SkSTArray<2, GrFragmentStage> fCoverageStages;
142 141
143 bool fAntiAlias; 142 bool fAntiAlias;
144 bool fDither; 143 bool fDither;
145 144
146 GrColor fColor; 145 GrColor fColor;
147 }; 146 };
148 147
149 #endif 148 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698