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

Side by Side Diff: src/opts/SkXfermode_opts.h

Issue 1264103004: Port SkBlurImage opts to SkOpts. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rename to match src/effects Created 5 years, 4 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
« no previous file with comments | « src/opts/SkOpts_sse41.cpp ('k') | src/opts/opts_check_x86.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 2015 Google Inc. 2 * Copyright 2015 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 #ifndef Sk4pxXfermode_DEFINED 8 #ifndef Sk4pxXfermode_DEFINED
9 #define Sk4pxXfermode_DEFINED 9 #define Sk4pxXfermode_DEFINED
10 10
11 #include "Sk4px.h" 11 #include "Sk4px.h"
12 #include "SkPMFloat.h" 12 #include "SkPMFloat.h"
13 #include "SkXfermode_proccoeff.h" 13 #include "SkXfermode_proccoeff.h"
14 14
15 // This file is possibly included into multiple .cpp files. 15 namespace /* TODO: SK_OPTS_NS */ {
16 // Each gets its own independent instantiation by wrapping in an anonymous names pace.
17 namespace {
18 16
19 // Most xfermodes can be done most efficiently 4 pixels at a time in 8 or 16-bit fixed point. 17 // Most xfermodes can be done most efficiently 4 pixels at a time in 8 or 16-bit fixed point.
20 #define XFERMODE(Name) static Sk4px SK_VECTORCALL Name(Sk4px s, Sk4px d) 18 #define XFERMODE(Name) static Sk4px SK_VECTORCALL Name(Sk4px s, Sk4px d)
21 19
22 XFERMODE(Clear) { return Sk4px::DupPMColor(0); } 20 XFERMODE(Clear) { return Sk4px::DupPMColor(0); }
23 XFERMODE(Src) { return s; } 21 XFERMODE(Src) { return s; }
24 XFERMODE(Dst) { return d; } 22 XFERMODE(Dst) { return d; }
25 XFERMODE(SrcIn) { return s.approxMulDiv255(d.alphas() ); } 23 XFERMODE(SrcIn) { return s.approxMulDiv255(d.alphas() ); }
26 XFERMODE(SrcOut) { return s.approxMulDiv255(d.alphas().inv()); } 24 XFERMODE(SrcOut) { return s.approxMulDiv255(d.alphas().inv()); }
27 XFERMODE(SrcOver) { return s + d.approxMulDiv255(s.alphas().inv()); } 25 XFERMODE(SrcOver) { return s + d.approxMulDiv255(s.alphas().inv()); }
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 CASE(ColorDodge); 307 CASE(ColorDodge);
310 CASE(ColorBurn); 308 CASE(ColorBurn);
311 CASE(SoftLight); 309 CASE(SoftLight);
312 #undef CASE 310 #undef CASE
313 311
314 default: break; 312 default: break;
315 } 313 }
316 return nullptr; 314 return nullptr;
317 } 315 }
318 316
319 } // namespace 317 } // namespace SK_NS_OPTS
320 318
321 #endif//Sk4pxXfermode_DEFINED 319 #endif//Sk4pxXfermode_DEFINED
OLDNEW
« no previous file with comments | « src/opts/SkOpts_sse41.cpp ('k') | src/opts/opts_check_x86.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698