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

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

Issue 25430005: Fix for potential typedef issue 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/SkLightingImageFilter.cpp ('k') | src/effects/SkTableColorFilter.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 "SkLumaXfermode.h" 8 #include "SkLumaXfermode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkFlattenableBuffers.h" 10 #include "SkFlattenableBuffers.h"
11 #include "SkString.h" 11 #include "SkString.h"
12 12
13 #if SK_SUPPORT_GPU 13 #if SK_SUPPORT_GPU
14 #include "gl/GrGLEffect.h" 14 #include "gl/GrGLEffect.h"
15 #include "gl/GrGLEffectMatrix.h" 15 #include "gl/GrGLEffectMatrix.h"
16 #include "GrContext.h" 16 #include "GrContext.h"
17 #include "GrTBackendEffectFactory.h" 17 #include "GrTBackendEffectFactory.h"
18 #endif 18 #endif
19 19
20 class SkLumaMaskXfermodeSrcOver : public SkLumaMaskXfermode { 20 class SkLumaMaskXfermodeSrcOver : public SkLumaMaskXfermode {
21 typedef SkLumaMaskXfermode INHERITED;
22
21 public: 23 public:
22 SkLumaMaskXfermodeSrcOver(); 24 SkLumaMaskXfermodeSrcOver();
23 25
24 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLumaMaskXfermodeSrcOve r) 26 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLumaMaskXfermodeSrcOve r)
25 27
26 protected: 28 protected:
27 SkLumaMaskXfermodeSrcOver(SkFlattenableReadBuffer&); 29 SkLumaMaskXfermodeSrcOver(SkFlattenableReadBuffer&);
28 30
29 private: 31 private:
30 typedef SkLumaMaskXfermode INHERITED;
31 32
32 virtual SkPMColor lumaProc(const SkPMColor a, const SkPMColor b) const; 33 virtual SkPMColor lumaProc(const SkPMColor a, const SkPMColor b) const;
33 }; 34 };
34 35
35 SkPMColor SkLumaMaskXfermode::lumaProc(const SkPMColor a, const SkPMColor b) con st { 36 SkPMColor SkLumaMaskXfermode::lumaProc(const SkPMColor a, const SkPMColor b) con st {
36 unsigned luma = SkComputeLuminance(SkGetPackedR32(b), 37 unsigned luma = SkComputeLuminance(SkGetPackedR32(b),
37 SkGetPackedG32(b), 38 SkGetPackedG32(b),
38 SkGetPackedB32(b)); 39 SkGetPackedB32(b));
39 return SkAlphaMulQ(a, SkAlpha255To256(luma)); 40 return SkAlphaMulQ(a, SkAlpha255To256(luma));
40 } 41 }
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // No background texture support. 269 // No background texture support.
269 if (effect && !background) { 270 if (effect && !background) {
270 *effect = GrLumaMaskEffect::Create(fMode); 271 *effect = GrLumaMaskEffect::Create(fMode);
271 return true; 272 return true;
272 } 273 }
273 274
274 return false; 275 return false;
275 } 276 }
276 277
277 #endif // SK_SUPPORT_GPU 278 #endif // SK_SUPPORT_GPU
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698