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

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

Issue 1334293003: Create fragment processor for performing input color blend with child processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix Created 5 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/GrProcessor.cpp ('k') | src/gpu/effects/GrCustomXfermode.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 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 #include "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 grPaint->setColor(paintColor); 727 grPaint->setColor(paintColor);
728 728
729 SkColorFilter* colorFilter = skPaint.getColorFilter(); 729 SkColorFilter* colorFilter = skPaint.getColorFilter();
730 if (colorFilter) { 730 if (colorFilter) {
731 // if the source color is a constant then apply the filter here once rat her than per pixel 731 // if the source color is a constant then apply the filter here once rat her than per pixel
732 // in a shader. 732 // in a shader.
733 if (constantColor) { 733 if (constantColor) {
734 SkColor filtered = colorFilter->filterColor(skPaint.getColor()); 734 SkColor filtered = colorFilter->filterColor(skPaint.getColor());
735 grPaint->setColor(SkColor2GrColor(filtered)); 735 grPaint->setColor(SkColor2GrColor(filtered));
736 } else { 736 } else {
737 SkTDArray<GrFragmentProcessor*> array; 737 SkTDArray<const GrFragmentProcessor*> array;
738 // return false if failed? 738 // return false if failed?
739 if (colorFilter->asFragmentProcessors(context, grPaint->getProcessor DataManager(), 739 if (colorFilter->asFragmentProcessors(context, grPaint->getProcessor DataManager(),
740 &array)) { 740 &array)) {
741 for (int i = 0; i < array.count(); ++i) { 741 for (int i = 0; i < array.count(); ++i) {
742 grPaint->addColorFragmentProcessor(array[i]); 742 grPaint->addColorFragmentProcessor(array[i]);
743 array[i]->unref(); 743 array[i]->unref();
744 } 744 }
745 } 745 }
746 } 746 }
747 } 747 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 SkErrorInternals::SetError( kInvalidPaint_SkError, 849 SkErrorInternals::SetError( kInvalidPaint_SkError,
850 "Sorry, I don't understand the filtering " 850 "Sorry, I don't understand the filtering "
851 "mode you asked for. Falling back to " 851 "mode you asked for. Falling back to "
852 "MIPMaps."); 852 "MIPMaps.");
853 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 853 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
854 break; 854 break;
855 855
856 } 856 }
857 return textureFilterMode; 857 return textureFilterMode;
858 } 858 }
OLDNEW
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | src/gpu/effects/GrCustomXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698