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

Unified Diff: src/core/SkPM4f.h

Issue 1713653002: make SkPM4f private (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more files Created 4 years, 10 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 | « src/core/SkModeColorFilter.cpp ('k') | src/core/SkPM4fPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPM4f.h
diff --git a/src/core/SkPM4f.h b/src/core/SkPM4f.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb22783dcc44203a8c3931982f645e3de7dde956
--- /dev/null
+++ b/src/core/SkPM4f.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPM4f_DEFINED
+#define SkPM4f_DEFINED
+
+#include "SkColorPriv.h"
+
+/*
+ * The float values are 0...1 premultiplied
+ */
+struct SkPM4f {
+ enum {
+ A = SK_A32_SHIFT/8,
+ R = SK_R32_SHIFT/8,
+ G = SK_G32_SHIFT/8,
+ B = SK_B32_SHIFT/8,
+ };
+ float fVec[4];
+
+ float a() const { return fVec[A]; }
+
+ SkColor4f unpremul() const;
+
+ static SkPM4f FromPMColor(SkPMColor);
+
+ // half-float routines
+ void toF16(uint16_t[4]) const;
+ uint64_t toF16() const; // 4 float16 values packed into uint64_t
+ static SkPM4f FromF16(const uint16_t[4]);
+
+#ifdef SK_DEBUG
+ void assertIsUnit() const;
+#else
+ void assertIsUnit() const {}
+#endif
+};
+
+typedef SkPM4f (*SkXfermodeProc4f)(const SkPM4f& src, const SkPM4f& dst);
+
+
+#endif
« no previous file with comments | « src/core/SkModeColorFilter.cpp ('k') | src/core/SkPM4fPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698