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

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

Issue 2087343002: Add stub for avx. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add inclusion of sse4 intrinsics if needed. Created 4 years, 6 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/core/SkOpts.cpp ('k') | src/opts/SkOpts_avx.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 2016 Google Inc. 2 * Copyright 2016 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 /* 8 /*
9 ninja -C out/Release dm nanobench ; and ./out/Release/dm --match Blend_opts ; an d ./out/Release/nanobench --samples 300 --nompd --match LinearSrcOver -q 9 ninja -C out/Release dm nanobench ; and ./out/Release/dm --match Blend_opts ; an d ./out/Release/nanobench --samples 300 --nompd --match LinearSrcOver -q
10 */ 10 */
11 11
12 #ifndef SkBlend_opts_DEFINED 12 #ifndef SkBlend_opts_DEFINED
13 #define SkBlend_opts_DEFINED 13 #define SkBlend_opts_DEFINED
14 14
15 #include "SkNx.h" 15 #include "SkNx.h"
16 #include "SkPM4fPriv.h" 16 #include "SkPM4fPriv.h"
17 17
18 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
19 #include <immintrin.h>
20 #endif
21
18 namespace SK_OPTS_NS { 22 namespace SK_OPTS_NS {
19 23
20 // An implementation of SrcOver from bytes to bytes in linear space that takes a dvantage of the 24 // An implementation of SrcOver from bytes to bytes in linear space that takes a dvantage of the
21 // observation that the 255's cancel. 25 // observation that the 255's cancel.
22 // invA = 1 - (As / 255); 26 // invA = 1 - (As / 255);
23 // 27 //
24 // R = 255 * sqrt((Rs/255)^2 + (Rd/255)^2 * invA) 28 // R = 255 * sqrt((Rs/255)^2 + (Rd/255)^2 * invA)
25 // => R = 255 * sqrt((Rs^2 + Rd^2 * invA)/255^2) 29 // => R = 255 * sqrt((Rs^2 + Rd^2 * invA)/255^2)
26 // => R = sqrt(Rs^2 + Rd^2 * invA) 30 // => R = sqrt(Rs^2 + Rd^2 * invA)
27 static inline void blend_srgb_srgb_1(uint32_t* dst, const uint32_t pixel) { 31 static inline void blend_srgb_srgb_1(uint32_t* dst, const uint32_t pixel) {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 void srcover_srgb_srgb( 245 void srcover_srgb_srgb(
242 uint32_t* dst, const uint32_t* const src, int ndst, const int nsrc) { 246 uint32_t* dst, const uint32_t* const src, int ndst, const int nsrc) {
243 trivial_srcover_srgb_srgb(dst, src, ndst, nsrc); 247 trivial_srcover_srgb_srgb(dst, src, ndst, nsrc);
244 } 248 }
245 249
246 #endif 250 #endif
247 251
248 } // namespace SK_OPTS_NS 252 } // namespace SK_OPTS_NS
249 253
250 #endif//SkBlend_opts_DEFINED 254 #endif//SkBlend_opts_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkOpts.cpp ('k') | src/opts/SkOpts_avx.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698