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

Side by Side Diff: src/gpu/effects/GrCustomXfermode.cpp

Issue 1626443002: Revert of Add gpu implementation of OverdrawXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrProcessor.cpp ('k') | src/gpu/effects/GrPorterDuffXferProcessor.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "effects/GrCustomXfermode.h" 8 #include "effects/GrCustomXfermode.h"
9 9
10 #include "GrCoordTransform.h" 10 #include "GrCoordTransform.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 const char* dstColor, 165 const char* dstColor,
166 const char* outColor, 166 const char* outColor,
167 const char* outColorSecondary, 167 const char* outColorSecondary,
168 const GrXferProcessor& proc) override { 168 const GrXferProcessor& proc) override {
169 const CustomXP& xp = proc.cast<CustomXP>(); 169 const CustomXP& xp = proc.cast<CustomXP>();
170 SkASSERT(!xp.hasHWBlendEquation()); 170 SkASSERT(!xp.hasHWBlendEquation());
171 171
172 GrGLSLBlend::AppendMode(fragBuilder, srcColor, dstColor, outColor, xp.mo de()); 172 GrGLSLBlend::AppendMode(fragBuilder, srcColor, dstColor, outColor, xp.mo de());
173 173
174 // Apply coverage. 174 // Apply coverage.
175 INHERITED::DefaultCoverageModulation(fragBuilder, srcCoverage, dstColor, outColor, 175 if (xp.dstReadUsesMixedSamples()) {
176 outColorSecondary, xp); 176 if (srcCoverage) {
177 fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage);
178 fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCover age);
179 } else {
180 fragBuilder->codeAppendf("%s = vec4(1.0);", outColorSecondary);
181 }
182 } else if (srcCoverage) {
183 fragBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;",
184 outColor, srcCoverage, outColor, srcCoverag e, dstColor);
185 }
177 } 186 }
178 187
179 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over ride {} 188 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over ride {}
180 189
181 typedef GrGLSLXferProcessor INHERITED; 190 typedef GrGLSLXferProcessor INHERITED;
182 }; 191 };
183 192
184 /////////////////////////////////////////////////////////////////////////////// 193 ///////////////////////////////////////////////////////////////////////////////
185 194
186 void CustomXP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuild er* b) const { 195 void CustomXP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuild er* b) const {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 400
392 /////////////////////////////////////////////////////////////////////////////// 401 ///////////////////////////////////////////////////////////////////////////////
393 402
394 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) { 403 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) {
395 if (!GrCustomXfermode::IsSupportedMode(mode)) { 404 if (!GrCustomXfermode::IsSupportedMode(mode)) {
396 return nullptr; 405 return nullptr;
397 } else { 406 } else {
398 return new CustomXPFactory(mode); 407 return new CustomXPFactory(mode);
399 } 408 }
400 } 409 }
OLDNEW
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698