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

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

Issue 866573002: XPFactory lazily initializie in drawstate / GrPaint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 11 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/GrDrawState.cpp ('k') | no next file » | 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/GrPorterDuffXferProcessor.h" 12 #include "effects/GrPorterDuffXferProcessor.h"
13 #include "effects/GrSimpleTextureEffect.h" 13 #include "effects/GrSimpleTextureEffect.h"
14 14
15 GrPaint::GrPaint()
16 : fAntiAlias(false)
17 , fDither(false)
18 , fColor(GrColor_WHITE) {
19 }
20
15 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri x) { 21 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri x) {
16 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unr ef(); 22 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unr ef();
17 } 23 }
18 24
19 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& ma trix) { 25 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& ma trix) {
20 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))-> unref(); 26 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))-> unref();
21 } 27 }
22 28
23 void GrPaint::addColorTextureProcessor(GrTexture* texture, 29 void GrPaint::addColorTextureProcessor(GrTexture* texture,
24 const SkMatrix& matrix, 30 const SkMatrix& matrix,
(...skipping 18 matching lines...) Expand all
43 GrXPFactory::InvariantOutput output; 49 GrXPFactory::InvariantOutput output;
44 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output); 50 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output);
45 51
46 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && 52 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags &&
47 0xFF == GrColorUnpackA(output.fBlendedColor)) { 53 0xFF == GrColorUnpackA(output.fBlendedColor)) {
48 *color = output.fBlendedColor; 54 *color = output.fBlendedColor;
49 return true; 55 return true;
50 } 56 }
51 return false; 57 return false;
52 } 58 }
53
54 void GrPaint::resetStages() {
55 fColorStages.reset();
56 fCoverageStages.reset();
57 fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode));
58 }
59
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698