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

Side by Side Diff: src/gpu/GrPaint.cpp

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 | « src/gpu/GrGpu.h ('k') | src/gpu/GrPipelineBuilder.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 2013 Google Inc. 3 * Copyright 2013 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 #include "GrPaint.h" 9 #include "GrPaint.h"
10 10
11 #include "GrProcOptInfo.h" 11 #include "GrProcOptInfo.h"
12 #include "effects/GrCoverageSetOpXP.h"
12 #include "effects/GrPorterDuffXferProcessor.h" 13 #include "effects/GrPorterDuffXferProcessor.h"
13 #include "effects/GrSimpleTextureEffect.h" 14 #include "effects/GrSimpleTextureEffect.h"
14 15
15 GrPaint::GrPaint() 16 GrPaint::GrPaint()
16 : fAntiAlias(false) 17 : fAntiAlias(false)
17 , fDither(false) 18 , fDither(false)
18 , fColor(GrColor_WHITE) { 19 , fColor(GrColor_WHITE) {
19 } 20 }
20 21
22 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera ge) {
23 fXPFactory.reset(GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage)) ;
24 }
25
21 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri x) { 26 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri x) {
22 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unr ef(); 27 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unr ef();
23 } 28 }
24 29
25 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& ma trix) { 30 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& ma trix) {
26 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))-> unref(); 31 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))-> unref();
27 } 32 }
28 33
29 void GrPaint::addColorTextureProcessor(GrTexture* texture, 34 void GrPaint::addColorTextureProcessor(GrTexture* texture,
30 const SkMatrix& matrix, 35 const SkMatrix& matrix,
(...skipping 18 matching lines...) Expand all
49 GrXPFactory::InvariantOutput output; 54 GrXPFactory::InvariantOutput output;
50 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output); 55 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output);
51 56
52 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && 57 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags &&
53 0xFF == GrColorUnpackA(output.fBlendedColor)) { 58 0xFF == GrColorUnpackA(output.fBlendedColor)) {
54 *color = output.fBlendedColor; 59 *color = output.fBlendedColor;
55 return true; 60 return true;
56 } 61 }
57 return false; 62 return false;
58 } 63 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrPipelineBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698