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

Side by Side Diff: src/core/SkLinearBitmapPipeline_core.h

Issue 1886233006: Add 8888 fast SrcOver mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean CL Created 4 years, 8 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 #ifndef SkLinearBitmapPipeline_core_DEFINED 8 #ifndef SkLinearBitmapPipeline_core_DEFINED
9 #define SkLinearBitmapPipeline_core_DEFINED 9 #define SkLinearBitmapPipeline_core_DEFINED
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 while (count >= 4) { 179 while (count >= 4) {
180 stage->pointList4(xs, ys); 180 stage->pointList4(xs, ys);
181 xs = xs + fourDx; 181 xs = xs + fourDx;
182 count -= 4; 182 count -= 4;
183 } 183 }
184 if (count > 0) { 184 if (count > 0) {
185 stage->pointListFew(count, xs, ys); 185 stage->pointListFew(count, xs, ys);
186 } 186 }
187 } 187 }
188
189 class sRGBFast {
190 public:
191 static Sk4f VECTORCALL sRGBToLinear(Sk4f pixel) {
192 Sk4f l = pixel * pixel;
193 return Sk4f{l[0], l[1], l[2], pixel[3]};
194 }
195 static Sk4f VECTORCALL LinearTosRGB(Sk4f pixel) {
196 Sk4f s = pixel.sqrt();
197 return Sk4f{s[0], s[1], s[2], pixel[3]};
198 }
199 };
200
188 } // namespace 201 } // namespace
189 202
190 #endif // SkLinearBitmapPipeline_core_DEFINED 203 #endif // SkLinearBitmapPipeline_core_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698