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

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

Issue 2184543003: Perform color correction on png decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@colorjpegs
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
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 dg = { sk_linear_from_srgb[(ptr[0] >> SK_G32_SHIFT) & 0xff], 238 dg = { sk_linear_from_srgb[(ptr[0] >> SK_G32_SHIFT) & 0xff],
239 sk_linear_from_srgb[(ptr[1] >> SK_G32_SHIFT) & 0xff], 239 sk_linear_from_srgb[(ptr[1] >> SK_G32_SHIFT) & 0xff],
240 sk_linear_from_srgb[(ptr[2] >> SK_G32_SHIFT) & 0xff], 240 sk_linear_from_srgb[(ptr[2] >> SK_G32_SHIFT) & 0xff],
241 sk_linear_from_srgb[(ptr[3] >> SK_G32_SHIFT) & 0xff] }; 241 sk_linear_from_srgb[(ptr[3] >> SK_G32_SHIFT) & 0xff] };
242 242
243 db = { sk_linear_from_srgb[(ptr[0] >> SK_B32_SHIFT) & 0xff], 243 db = { sk_linear_from_srgb[(ptr[0] >> SK_B32_SHIFT) & 0xff],
244 sk_linear_from_srgb[(ptr[1] >> SK_B32_SHIFT) & 0xff], 244 sk_linear_from_srgb[(ptr[1] >> SK_B32_SHIFT) & 0xff],
245 sk_linear_from_srgb[(ptr[2] >> SK_B32_SHIFT) & 0xff], 245 sk_linear_from_srgb[(ptr[2] >> SK_B32_SHIFT) & 0xff],
246 sk_linear_from_srgb[(ptr[3] >> SK_B32_SHIFT) & 0xff] }; 246 sk_linear_from_srgb[(ptr[3] >> SK_B32_SHIFT) & 0xff] };
247 247
248 // TODO: this >> doesn't really need mask if we make it logical instead of a rithmetic. 248 da = SkNx_cast<float>((Sk4i::Load(ptr)).logicalShiftRight(SK_A32_SHIFT)) * ( 1/255.0f);
249 da = SkNx_cast<float>((Sk4i::Load(ptr) >> SK_A32_SHIFT) & 0xff) * (1/255.0f) ;
250 249
251 st->next(x, r,g,b,a, dr,dg,db,da); 250 st->next(x, r,g,b,a, dr,dg,db,da);
252 } 251 }
253 252
254 // Tail variant of load_d_srgb() handling 1 pixel at a time. 253 // Tail variant of load_d_srgb() handling 1 pixel at a time.
255 static void SK_VECTORCALL load_d_srgb_1(SkRasterPipeline::Stage* st, size_t x, 254 static void SK_VECTORCALL load_d_srgb_1(SkRasterPipeline::Stage* st, size_t x,
256 Sk4f r, Sk4f g, Sk4f b, Sk4f a, 255 Sk4f r, Sk4f g, Sk4f b, Sk4f a,
257 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) { 256 Sk4f dr, Sk4f dg, Sk4f db, Sk4f da) {
258 auto ptr = st->ctx<const uint32_t*>() + x; 257 auto ptr = st->ctx<const uint32_t*>() + x;
259 258
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 case SkMask::kLCD16_Format: 433 case SkMask::kLCD16_Format:
435 p.append(lerp_lcd16, lerp_lcd16_1, mask.getAddrLCD16(x,y)-x); 434 p.append(lerp_lcd16, lerp_lcd16_1, mask.getAddrLCD16(x,y)-x);
436 break; 435 break;
437 default: break; 436 default: break;
438 } 437 }
439 this->append_store(&p, dst); 438 this->append_store(&p, dst);
440 439
441 p.run(x, clip.width()); 440 p.run(x, clip.width());
442 } 441 }
443 } 442 }
OLDNEW
« no previous file with comments | « src/core/SkOpts.cpp ('k') | src/opts/SkColorXform_opts.h » ('j') | src/opts/SkOpts_sse41.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698