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

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

Issue 2184753002: Add Sk4h_load4 for loading F16. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typo 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
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 auto ptr = st->ctx<uint16_t*>() + x; 224 auto ptr = st->ctx<uint16_t*>() + x;
225 *ptr = to_565(r,g,b)[0]; 225 *ptr = to_565(r,g,b)[0];
226 } 226 }
227 227
228 // Load 4 F16 pixels. 228 // Load 4 F16 pixels.
229 static void SK_VECTORCALL load_d_f16(SkRasterPipeline::Stage* st, size_t x, 229 static void SK_VECTORCALL load_d_f16(SkRasterPipeline::Stage* st, size_t x,
230 Sk4f r, Sk4f g, Sk4f b, Sk4f a, 230 Sk4f r, Sk4f g, Sk4f b, Sk4f a,
231 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) { 231 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) {
232 auto ptr = st->ctx<const uint64_t*>() + x; 232 auto ptr = st->ctx<const uint64_t*>() + x;
233 233
234 // TODO: This can be made a lot more efficient with platform-specific code. 234 Sk4h rh, gh, bh, ah;
235 auto p0 = SkHalfToFloat_finite(ptr[0]), 235 Sk4h_load4(ptr, &rh, &gh, &bh, &ah);
236 p1 = SkHalfToFloat_finite(ptr[1]), 236
237 p2 = SkHalfToFloat_finite(ptr[2]), 237 dr = SkHalfToFloat_finite(rh);
238 p3 = SkHalfToFloat_finite(ptr[3]); 238 dg = SkHalfToFloat_finite(gh);
239 dr = { p0[0], p1[0], p2[0], p3[0] }; 239 db = SkHalfToFloat_finite(bh);
240 dg = { p0[1], p1[1], p2[1], p3[1] }; 240 da = SkHalfToFloat_finite(ah);
241 db = { p0[2], p1[2], p2[2], p3[2] };
242 da = { p0[3], p1[3], p2[3], p3[3] };
243 241
244 st->next(x, r,g,b,a, dr,dg,db,da); 242 st->next(x, r,g,b,a, dr,dg,db,da);
245 } 243 }
246 244
247 // Load 1 F16 pixel. 245 // Load 1 F16 pixel.
248 static void SK_VECTORCALL load_d_f16_1(SkRasterPipeline::Stage* st, size_t x, 246 static void SK_VECTORCALL load_d_f16_1(SkRasterPipeline::Stage* st, size_t x,
249 Sk4f r, Sk4f g, Sk4f b, Sk4f a, 247 Sk4f r, Sk4f g, Sk4f b, Sk4f a,
250 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) { 248 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) {
251 auto ptr = st->ctx<const uint64_t*>() + x; 249 auto ptr = st->ctx<const uint64_t*>() + x;
252 250
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 case SkMask::kLCD16_Format: 492 case SkMask::kLCD16_Format:
495 p.append(lerp_lcd16, lerp_lcd16_1, mask.getAddrLCD16(x,y)-x); 493 p.append(lerp_lcd16, lerp_lcd16_1, mask.getAddrLCD16(x,y)-x);
496 break; 494 break;
497 default: break; 495 default: break;
498 } 496 }
499 this->append_store(&p, dst); 497 this->append_store(&p, dst);
500 498
501 p.run(x, clip.width()); 499 p.run(x, clip.width());
502 } 500 }
503 } 501 }
OLDNEW
« no previous file with comments | « src/core/SkNx.h ('k') | src/opts/SkNx_neon.h » ('j') | src/opts/SkNx_sse.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698