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

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

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring Created 4 years, 5 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 | « include/gpu/GrColorSpaceXform.h ('k') | src/core/SkBitmapProcShader.cpp » ('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 "GrColorSpaceXform.h"
14 #include "GrXferProcessor.h" 15 #include "GrXferProcessor.h"
15 #include "effects/GrPorterDuffXferProcessor.h" 16 #include "effects/GrPorterDuffXferProcessor.h"
16 #include "GrFragmentProcessor.h" 17 #include "GrFragmentProcessor.h"
17 18
18 #include "SkRefCnt.h" 19 #include "SkRefCnt.h"
19 #include "SkRegion.h" 20 #include "SkRegion.h"
20 #include "SkXfermode.h" 21 #include "SkXfermode.h"
21 22
22 /** 23 /**
23 * The paint describes how color and coverage are computed at each pixel by GrCo ntext draw 24 * The paint describes how color and coverage are computed at each pixel by GrCo ntext draw
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 */ 109 */
109 void addCoverageFragmentProcessor(sk_sp<GrFragmentProcessor> fp) { 110 void addCoverageFragmentProcessor(sk_sp<GrFragmentProcessor> fp) {
110 SkASSERT(fp); 111 SkASSERT(fp);
111 fCoverageFragmentProcessors.push_back(std::move(fp)); 112 fCoverageFragmentProcessors.push_back(std::move(fp));
112 } 113 }
113 114
114 /** 115 /**
115 * Helpers for adding color or coverage effects that sample a texture. The m atrix is applied 116 * Helpers for adding color or coverage effects that sample a texture. The m atrix is applied
116 * to the src space position to compute texture coordinates. 117 * to the src space position to compute texture coordinates.
117 */ 118 */
118 void addColorTextureProcessor(GrTexture*, const SkMatrix&); 119 void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const Sk Matrix&);
119 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&); 120 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&);
120 void addColorTextureProcessor(GrTexture*, const SkMatrix&, const GrTexturePa rams&); 121 void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const Sk Matrix&,
122 const GrTextureParams&);
121 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&, const GrTextur eParams&); 123 void addCoverageTextureProcessor(GrTexture*, const SkMatrix&, const GrTextur eParams&);
122 124
123 int numColorFragmentProcessors() const { return fColorFragmentProcessors.cou nt(); } 125 int numColorFragmentProcessors() const { return fColorFragmentProcessors.cou nt(); }
124 int numCoverageFragmentProcessors() const { return fCoverageFragmentProcesso rs.count(); } 126 int numCoverageFragmentProcessors() const { return fCoverageFragmentProcesso rs.count(); }
125 int numTotalFragmentProcessors() const { return this->numColorFragmentProces sors() + 127 int numTotalFragmentProcessors() const { return this->numColorFragmentProces sors() +
126 this->numCoverageFragmentProcessor s(); } 128 this->numCoverageFragmentProcessor s(); }
127 129
128 GrXPFactory* getXPFactory() const { 130 GrXPFactory* getXPFactory() const {
129 return fXPFactory.get(); 131 return fXPFactory.get();
130 } 132 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 SkSTArray<2, sk_sp<GrFragmentProcessor>> fCoverageFragmentProcessors; 166 SkSTArray<2, sk_sp<GrFragmentProcessor>> fCoverageFragmentProcessors;
165 167
166 bool fAntiAlias; 168 bool fAntiAlias;
167 bool fDisableOutputConversionToSRGB; 169 bool fDisableOutputConversionToSRGB;
168 bool fAllowSRGBInputs; 170 bool fAllowSRGBInputs;
169 171
170 GrColor4f fColor; 172 GrColor4f fColor;
171 }; 173 };
172 174
173 #endif 175 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrColorSpaceXform.h ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698