| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |