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

Side by Side Diff: src/effects/SkColorFilters.cpp

Issue 26190003: Potentially optimize some GrGLEffects for known input color values (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBitmapAlphaThresholdShader.cpp ('k') | src/effects/SkColorMatrixFilter.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBlitRow.h" 10 #include "SkBlitRow.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 class GLEffect : public GrGLEffect { 223 class GLEffect : public GrGLEffect {
224 public: 224 public:
225 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) 225 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&)
226 : INHERITED(factory) { 226 : INHERITED(factory) {
227 } 227 }
228 228
229 virtual void emitCode(GrGLShaderBuilder* builder, 229 virtual void emitCode(GrGLShaderBuilder* builder,
230 const GrDrawEffect& drawEffect, 230 const GrDrawEffect& drawEffect,
231 EffectKey key, 231 EffectKey key,
232 const char* outputColor, 232 const char* outputColor,
233 const char* inputColor, 233 const GrGLSLExpr4& inputColor,
234 const TransformedCoordsArray& coords, 234 const TransformedCoordsArray& coords,
235 const TextureSamplerArray& samplers) SK_OVERRIDE { 235 const TextureSamplerArray& samplers) SK_OVERRIDE {
236 SkXfermode::Mode mode = drawEffect.castEffect<ModeColorFilterEffect> ().mode(); 236 SkXfermode::Mode mode = drawEffect.castEffect<ModeColorFilterEffect> ().mode();
237 237
238 SkASSERT(SkXfermode::kDst_Mode != mode); 238 SkASSERT(SkXfermode::kDst_Mode != mode);
239 const char* colorFilterColorUniName = NULL; 239 const char* colorFilterColorUniName = NULL;
240 if (drawEffect.castEffect<ModeColorFilterEffect>().willUseFilterColo r()) { 240 if (drawEffect.castEffect<ModeColorFilterEffect>().willUseFilterColo r()) {
241 fFilterColorUni = builder->addUniform(GrGLShaderBuilder::kFragme nt_Visibility, 241 fFilterColorUni = builder->addUniform(GrGLShaderBuilder::kFragme nt_Visibility,
242 kVec4f_GrSLType, "FilterCo lor", 242 kVec4f_GrSLType, "FilterCo lor",
243 &colorFilterColorUniName); 243 &colorFilterColorUniName);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter) 831 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter)
832 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(Src_SkModeColorFilter) 832 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(Src_SkModeColorFilter)
833 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SrcOver_SkModeColorFilter) 833 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SrcOver_SkModeColorFilter)
834 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter) 834 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter)
835 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_JustAdd) 835 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_JustAdd)
836 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_JustMul) 836 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_JustMul)
837 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_SingleMul) 837 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_SingleMul)
838 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_NoPin) 838 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingColorFilter_NoPin)
839 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSimpleColorFilter) 839 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSimpleColorFilter)
840 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 840 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkBitmapAlphaThresholdShader.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698