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

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

Issue 787233003: Add XP to handle the cases where we disable color write. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 6 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 | « src/gpu/GrOptDrawState.cpp ('k') | src/gpu/GrPathRenderer.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
(...skipping 23 matching lines...) Expand all
34 34
35 bool GrPaint::isOpaqueAndConstantColor(GrColor* color) const { 35 bool GrPaint::isOpaqueAndConstantColor(GrColor* color) const {
36 GrProcOptInfo coverageProcInfo; 36 GrProcOptInfo coverageProcInfo;
37 coverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->numCov erageStages(), 37 coverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->numCov erageStages(),
38 0xFFFFFFFF, kRGBA_GrColorComponentFla gs, true); 38 0xFFFFFFFF, kRGBA_GrColorComponentFla gs, true);
39 GrProcOptInfo colorProcInfo; 39 GrProcOptInfo colorProcInfo;
40 colorProcInfo.calcWithInitialValues(fColorStages.begin(), this->numColorStag es(), fColor, 40 colorProcInfo.calcWithInitialValues(fColorStages.begin(), this->numColorStag es(), fColor,
41 kRGBA_GrColorComponentFlags, false); 41 kRGBA_GrColorComponentFlags, false);
42 42
43 GrXPFactory::InvariantOutput output; 43 GrXPFactory::InvariantOutput output;
44 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, true, &outpu t); 44 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output);
45 45
46 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && 46 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags &&
47 0xFF == GrColorUnpackA(output.fBlendedColor)) { 47 0xFF == GrColorUnpackA(output.fBlendedColor)) {
48 *color = output.fBlendedColor; 48 *color = output.fBlendedColor;
49 return true; 49 return true;
50 } 50 }
51 return false; 51 return false;
52 } 52 }
53 53
54 void GrPaint::resetStages() { 54 void GrPaint::resetStages() {
55 fColorStages.reset(); 55 fColorStages.reset();
56 fCoverageStages.reset(); 56 fCoverageStages.reset();
57 fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode)); 57 fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode));
58 } 58 }
59 59
OLDNEW
« no previous file with comments | « src/gpu/GrOptDrawState.cpp ('k') | src/gpu/GrPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698