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

Side by Side Diff: src/core/SkLinearBitmapPipeline_sample.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, 7 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_sampler_DEFINED 8 #ifndef SkLinearBitmapPipeline_sampler_DEFINED
9 #define SkLinearBitmapPipeline_sampler_DEFINED 9 #define SkLinearBitmapPipeline_sampler_DEFINED
10 10
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 x += dx; 553 x += dx;
554 count -= 1; 554 count -= 1;
555 } 555 }
556 } 556 }
557 } 557 }
558 558
559 Next* const fNext; 559 Next* const fNext;
560 SourceStrategy fStrategy; 560 SourceStrategy fStrategy;
561 }; 561 };
562 562
563 class sRGBFast {
564 public:
565 static Sk4s VECTORCALL sRGBToLinear(Sk4s pixel) {
566 Sk4s l = pixel * pixel;
567 return Sk4s{l[0], l[1], l[2], pixel[3]};
568 }
569 };
570
571 enum class ColorOrder { 563 enum class ColorOrder {
572 kRGBA = false, 564 kRGBA = false,
573 kBGRA = true, 565 kBGRA = true,
574 }; 566 };
575 template <SkColorProfileType colorProfile, ColorOrder colorOrder> 567 template <SkColorProfileType colorProfile, ColorOrder colorOrder>
576 class Pixel8888 { 568 class Pixel8888 {
577 public: 569 public:
578 Pixel8888(int width, const uint32_t* src) : fSrc{src}, fWidth{width}{ } 570 Pixel8888(int width, const uint32_t* src) : fSrc{src}, fWidth{width}{ }
579 Pixel8888(const SkPixmap& srcPixmap) 571 Pixel8888(const SkPixmap& srcPixmap)
580 : fSrc{srcPixmap.addr32()} 572 : fSrc{srcPixmap.addr32()}
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 const void* row(int y) { return fSrc + y * fWidth[0]; } 776 const void* row(int y) { return fSrc + y * fWidth[0]; }
785 777
786 private: 778 private:
787 const uint64_t* const fSrc; 779 const uint64_t* const fSrc;
788 const Sk4i fWidth; 780 const Sk4i fWidth;
789 }; 781 };
790 782
791 } // namespace 783 } // namespace
792 784
793 #endif // SkLinearBitmapPipeline_sampler_DEFINED 785 #endif // SkLinearBitmapPipeline_sampler_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698