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

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

Issue 2324553002: Push usage of GrColor4f into OverrideInput (Closed)
Patch Set: Remove TODO comment Created 4 years, 3 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/GrFragmentProcessor.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 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 #include "SkGrPriv.h" 10 #include "SkGrPriv.h"
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 bool applyColorFilterToPaintColor = false; 562 bool applyColorFilterToPaintColor = false;
563 if (shaderFP) { 563 if (shaderFP) {
564 if (primColorMode) { 564 if (primColorMode) {
565 // There is a blend between the primitive color and the shader color . The shader sees 565 // There is a blend between the primitive color and the shader color . The shader sees
566 // the opaque paint color. The shader's output is blended using the provided mode by 566 // the opaque paint color. The shader's output is blended using the provided mode by
567 // the primitive color. The blended color is then modulated by the p aint's alpha. 567 // the primitive color. The blended color is then modulated by the p aint's alpha.
568 568
569 // The geometry processor will insert the primitive color to start t he color chain, so 569 // The geometry processor will insert the primitive color to start t he color chain, so
570 // the GrPaint color will be ignored. 570 // the GrPaint color will be ignored.
571 571
572 GrColor shaderInput = origColor.opaque().toGrColor(); 572 GrColor4f shaderInput = origColor.opaque();
573
574 // SRGBTODO: Preserve 4f on this code path
575 shaderFP = GrFragmentProcessor::OverrideInput(shaderFP, shaderInput) ; 573 shaderFP = GrFragmentProcessor::OverrideInput(shaderFP, shaderInput) ;
576 if (primitiveIsSrc) { 574 if (primitiveIsSrc) {
577 shaderFP = GrXfermodeFragmentProcessor::MakeFromDstProcessor(std ::move(shaderFP), 575 shaderFP = GrXfermodeFragmentProcessor::MakeFromDstProcessor(std ::move(shaderFP),
578 *pr imColorMode); 576 *pr imColorMode);
579 } else { 577 } else {
580 shaderFP = GrXfermodeFragmentProcessor::MakeFromSrcProcessor(std ::move(shaderFP), 578 shaderFP = GrXfermodeFragmentProcessor::MakeFromSrcProcessor(std ::move(shaderFP),
581 *pr imColorMode); 579 *pr imColorMode);
582 } 580 }
583 // The above may return null if compose results in a pass through of the prim color. 581 // The above may return null if compose results in a pass through of the prim color.
584 if (shaderFP) { 582 if (shaderFP) {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 SkErrorInternals::SetError( kInvalidPaint_SkError, 770 SkErrorInternals::SetError( kInvalidPaint_SkError,
773 "Sorry, I don't understand the filtering " 771 "Sorry, I don't understand the filtering "
774 "mode you asked for. Falling back to " 772 "mode you asked for. Falling back to "
775 "MIPMaps."); 773 "MIPMaps.");
776 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 774 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
777 break; 775 break;
778 776
779 } 777 }
780 return textureFilterMode; 778 return textureFilterMode;
781 } 779 }
OLDNEW
« no previous file with comments | « src/gpu/GrFragmentProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698