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

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

Issue 699943003: Move GrInvariantOutput out of GrProcessor and into its own class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanup Created 6 years, 1 month 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 "gl/GrGLProcessor.h" 14 #include "gl/GrGLProcessor.h"
15 #include "gl/builders/GrGLProgramBuilder.h" 15 #include "gl/builders/GrGLProgramBuilder.h"
16 #include "GrContext.h" 16 #include "GrContext.h"
17 #include "GrInvariantOutput.h"
17 #include "GrTBackendProcessorFactory.h" 18 #include "GrTBackendProcessorFactory.h"
18 #endif 19 #endif
19 20
20 void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count, 21 void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count,
21 SkPMColor dst[]) const { 22 SkPMColor dst[]) const {
22 for (int i = 0; i < count; ++i) { 23 for (int i = 0; i < count; ++i) {
23 SkPMColor c = src[i]; 24 SkPMColor c = src[i];
24 25
25 /* 26 /*
26 * While LuminanceToAlpha is defined to operate on un-premultiplied 27 * While LuminanceToAlpha is defined to operate on un-premultiplied
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 } 106 }
106 107
107 private: 108 private:
108 typedef GrGLFragmentProcessor INHERITED; 109 typedef GrGLFragmentProcessor INHERITED;
109 }; 110 };
110 111
111 private: 112 private:
112 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { retur n true; } 113 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { retur n true; }
113 114
114 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 115 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE RRIDE {
115 // The output is always black. The alpha value for the color passed in i s arbitrary. 116 // The output is always black. The alpha value for the color passed in i s arbitrary.
116 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0 ), 117 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0 ),
117 InvariantOutput::kWill_ReadInput); 118 GrInvariantOutput::kWill_ReadInput);
118 } 119 }
119 }; 120 };
120 121
121 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const { 122 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const {
122 return LumaColorFilterEffect::Create(); 123 return LumaColorFilterEffect::Create();
123 } 124 }
124 #endif 125 #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