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

Side by Side Diff: src/gpu/glsl/GrGLSLXferProcessor.cpp

Issue 1631873002: Add gpu backend for SkPixelXorXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: And fix case where the srcColor is null Created 4 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/glsl/GrGLSLXferProcessor.h ('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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "glsl/GrGLSLXferProcessor.h" 8 #include "glsl/GrGLSLXferProcessor.h"
9 9
10 #include "GrXferProcessor.h" 10 #include "GrXferProcessor.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } else { 81 } else {
82 SkASSERT(!fDstScaleUni.isValid()); 82 SkASSERT(!fDstScaleUni.isValid());
83 } 83 }
84 } else { 84 } else {
85 SkASSERT(!fDstTopLeftUni.isValid()); 85 SkASSERT(!fDstTopLeftUni.isValid());
86 SkASSERT(!fDstScaleUni.isValid()); 86 SkASSERT(!fDstScaleUni.isValid());
87 } 87 }
88 this->onSetData(pdm, xp); 88 this->onSetData(pdm, xp);
89 } 89 }
90 90
91 void GrGLSLXferProcessor::DefaultCoverageModulation(GrGLSLXPFragmentBuilder* fra gBuilder,
92 const char* srcCoverage,
93 const char* dstColor,
94 const char* outColor,
95 const char* outColorSecondar y,
96 const GrXferProcessor& proc) {
97 if (proc.dstReadUsesMixedSamples()) {
98 if (srcCoverage) {
99 fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage);
100 fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCoverage) ;
101 } else {
102 fragBuilder->codeAppendf("%s = vec4(1.0);", outColorSecondary);
103 }
104 } else if (srcCoverage) {
105 fragBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;",
106 outColor, srcCoverage, outColor, srcCoverage, d stColor);
107 }
108 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLXferProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698