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

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

Issue 1490283004: Create GLSLUniformHandler class for gpu backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up public api of uniformhandler Created 5 years 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/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.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 2013 Google Inc. 2 * Copyright 2013 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 "SkLumaColorFilter.h" 8 #include "SkLumaColorFilter.h"
9 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
11 #include "SkString.h" 11 #include "SkString.h"
12 12
13 #if SK_SUPPORT_GPU 13 #if SK_SUPPORT_GPU
14 #include "GrContext.h" 14 #include "GrContext.h"
15 #include "GrInvariantOutput.h" 15 #include "GrInvariantOutput.h"
16 #include "glsl/GrGLSLFragmentProcessor.h" 16 #include "glsl/GrGLSLFragmentProcessor.h"
17 #include "glsl/GrGLSLFragmentShaderBuilder.h" 17 #include "glsl/GrGLSLFragmentShaderBuilder.h"
18 #include "glsl/GrGLSLProgramBuilder.h"
19 #endif 18 #endif
20 19
21 void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count, 20 void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count,
22 SkPMColor dst[]) const { 21 SkPMColor dst[]) const {
23 for (int i = 0; i < count; ++i) { 22 for (int i = 0; i < count; ++i) {
24 SkPMColor c = src[i]; 23 SkPMColor c = src[i];
25 24
26 /* 25 /*
27 * While LuminanceToAlpha is defined to operate on un-premultiplied 26 * While LuminanceToAlpha is defined to operate on un-premultiplied
28 * inputs, due to the final alpha scaling it can be computed based on 27 * inputs, due to the final alpha scaling it can be computed based on
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0 ), 107 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0 ),
109 GrInvariantOutput::kWill_ReadInput); 108 GrInvariantOutput::kWill_ReadInput);
110 } 109 }
111 }; 110 };
112 111
113 const GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) co nst { 112 const GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) co nst {
114 113
115 return LumaColorFilterEffect::Create(); 114 return LumaColorFilterEffect::Create();
116 } 115 }
117 #endif 116 #endif
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698