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

Unified Diff: src/core/Sk4px.h

Issue 1242973004: Revert of 565 support for SIMD xfermodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/Sk4pxXfermode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/Sk4px.h
diff --git a/src/core/Sk4px.h b/src/core/Sk4px.h
index 7d51fd099ebef818c58d15ebeb7acad265d82c6d..e1d4dc1244b0804b4146d491415d7a7d43e5ff92 100644
--- a/src/core/Sk4px.h
+++ b/src/core/Sk4px.h
@@ -10,7 +10,6 @@
#include "SkNx.h"
#include "SkColor.h"
-#include "SkColorPriv.h"
// This file may be included multiple times by .cpp files with different flags, leading
// to different definitions. Usually that doesn't matter because it's all inlined, but
@@ -47,14 +46,6 @@
void store4(SkPMColor[4]) const;
void store2(SkPMColor[2]) const;
void store1(SkPMColor[1]) const;
-
- // Same as above for 565.
- static Sk4px Load4(const SkPMColor16 src[4]);
- static Sk4px Load2(const SkPMColor16 src[2]);
- static Sk4px Load1(const SkPMColor16 src[1]);
- void store4(SkPMColor16 dst[4]) const;
- void store2(SkPMColor16 dst[2]) const;
- void store1(SkPMColor16 dst[1]) const;
// 1, 2, or 4 SkPMColors with 16-bit components.
// This is most useful as the result of a multiply, e.g. from mulWiden().
@@ -108,8 +99,8 @@
// A generic driver that maps fn over a src array into a dst array.
// fn should take an Sk4px (4 src pixels) and return an Sk4px (4 dst pixels).
- template <typename Fn, typename Dst>
- static void MapSrc(int n, Dst* dst, const SkPMColor* src, const Fn& fn) {
+ template <typename Fn>
+ static void MapSrc(int n, SkPMColor* dst, const SkPMColor* src, const Fn& fn) {
// This looks a bit odd, but it helps loop-invariant hoisting across different calls to fn.
// Basically, we need to make sure we keep things inside a single loop.
while (n > 0) {
@@ -138,8 +129,8 @@
}
// As above, but with dst4' = fn(dst4, src4).
- template <typename Fn, typename Dst>
- static void MapDstSrc(int n, Dst* dst, const SkPMColor* src, const Fn& fn) {
+ template <typename Fn>
+ static void MapDstSrc(int n, SkPMColor* dst, const SkPMColor* src, const Fn& fn) {
while (n > 0) {
if (n >= 8) {
Sk4px dst0 = fn(Load4(dst+0), Load4(src+0)),
@@ -166,8 +157,8 @@
}
// As above, but with dst4' = fn(dst4, src4, alpha4).
- template <typename Fn, typename Dst>
- static void MapDstSrcAlpha(int n, Dst* dst, const SkPMColor* src, const SkAlpha* a,
+ template <typename Fn>
+ static void MapDstSrcAlpha(int n, SkPMColor* dst, const SkPMColor* src, const SkAlpha* a,
const Fn& fn) {
while (n > 0) {
if (n >= 8) {
@@ -197,39 +188,6 @@
private:
typedef Sk16b INHERITED;
};
-
-// TODO: specialize these per-backend
-
-inline Sk4px Sk4px::Load4(const SkPMColor16 src[4]) {
- SkPMColor src32[4];
- for (int i = 0; i < 4; i++) { src32[i] = SkPixel16ToPixel32(src[i]); }
- return Load4(src32);
-}
-inline Sk4px Sk4px::Load2(const SkPMColor16 src[2]) {
- SkPMColor src32[2];
- for (int i = 0; i < 2; i++) { src32[i] = SkPixel16ToPixel32(src[i]); }
- return Load2(src32);
-}
-inline Sk4px Sk4px::Load1(const SkPMColor16 src[1]) {
- SkPMColor src32 = SkPixel16ToPixel32(src[0]);
- return Load1(&src32);
-}
-
-inline void Sk4px::store4(SkPMColor16 dst[4]) const {
- SkPMColor dst32[4];
- this->store4(dst32);
- for (int i = 0; i < 4; i++) { dst[i] = SkPixel32ToPixel16(dst32[i]); }
-}
-inline void Sk4px::store2(SkPMColor16 dst[2]) const {
- SkPMColor dst32[2];
- this->store2(dst32);
- for (int i = 0; i < 2; i++) { dst[i] = SkPixel32ToPixel16(dst32[i]); }
-}
-inline void Sk4px::store1(SkPMColor16 dst[1]) const {
- SkPMColor dst32;
- this->store1(&dst32);
- dst[0] = SkPixel32ToPixel16(dst32);
-}
} // namespace
« no previous file with comments | « no previous file | src/core/Sk4pxXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698