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

Side by Side Diff: src/core/SkRasterPipelineBlitter.cpp

Issue 2197683002: SkNx: add Sk4u (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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/core/SkNx.h ('k') | src/opts/SkNx_neon.h » ('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 #include "SkBlitter.h" 8 #include "SkBlitter.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 dg = { sk_linear_from_srgb[(ptr[0] >> SK_G32_SHIFT) & 0xff], 290 dg = { sk_linear_from_srgb[(ptr[0] >> SK_G32_SHIFT) & 0xff],
291 sk_linear_from_srgb[(ptr[1] >> SK_G32_SHIFT) & 0xff], 291 sk_linear_from_srgb[(ptr[1] >> SK_G32_SHIFT) & 0xff],
292 sk_linear_from_srgb[(ptr[2] >> SK_G32_SHIFT) & 0xff], 292 sk_linear_from_srgb[(ptr[2] >> SK_G32_SHIFT) & 0xff],
293 sk_linear_from_srgb[(ptr[3] >> SK_G32_SHIFT) & 0xff] }; 293 sk_linear_from_srgb[(ptr[3] >> SK_G32_SHIFT) & 0xff] };
294 294
295 db = { sk_linear_from_srgb[(ptr[0] >> SK_B32_SHIFT) & 0xff], 295 db = { sk_linear_from_srgb[(ptr[0] >> SK_B32_SHIFT) & 0xff],
296 sk_linear_from_srgb[(ptr[1] >> SK_B32_SHIFT) & 0xff], 296 sk_linear_from_srgb[(ptr[1] >> SK_B32_SHIFT) & 0xff],
297 sk_linear_from_srgb[(ptr[2] >> SK_B32_SHIFT) & 0xff], 297 sk_linear_from_srgb[(ptr[2] >> SK_B32_SHIFT) & 0xff],
298 sk_linear_from_srgb[(ptr[3] >> SK_B32_SHIFT) & 0xff] }; 298 sk_linear_from_srgb[(ptr[3] >> SK_B32_SHIFT) & 0xff] };
299 299
300 // TODO: this >> doesn't really need mask if we make it logical instead of a rithmetic. 300 da = SkNx_cast<float>(Sk4u::Load(ptr) >> SK_A32_SHIFT) * (1/255.0f);
301 da = SkNx_cast<float>((Sk4i::Load(ptr) >> SK_A32_SHIFT) & 0xff) * (1/255.0f) ;
302 301
303 st->next(x, r,g,b,a, dr,dg,db,da); 302 st->next(x, r,g,b,a, dr,dg,db,da);
304 } 303 }
305 304
306 // Tail variant of load_d_srgb() handling 1 pixel at a time. 305 // Tail variant of load_d_srgb() handling 1 pixel at a time.
307 static void SK_VECTORCALL load_d_srgb_1(SkRasterPipeline::Stage* st, size_t x, 306 static void SK_VECTORCALL load_d_srgb_1(SkRasterPipeline::Stage* st, size_t x,
308 Sk4f r, Sk4f g, Sk4f b, Sk4f a, 307 Sk4f r, Sk4f g, Sk4f b, Sk4f a,
309 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) { 308 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) {
310 auto ptr = st->ctx<const uint32_t*>() + x; 309 auto ptr = st->ctx<const uint32_t*>() + x;
311 310
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 case SkMask::kLCD16_Format: 491 case SkMask::kLCD16_Format:
493 p.append(lerp_lcd16, lerp_lcd16_1, mask.getAddrLCD16(x,y)-x); 492 p.append(lerp_lcd16, lerp_lcd16_1, mask.getAddrLCD16(x,y)-x);
494 break; 493 break;
495 default: break; 494 default: break;
496 } 495 }
497 this->append_store(&p, dst); 496 this->append_store(&p, dst);
498 497
499 p.run(x, clip.width()); 498 p.run(x, clip.width());
500 } 499 }
501 } 500 }
OLDNEW
« no previous file with comments | « src/core/SkNx.h ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698