Index: src/core/SkWriteBuffer.cpp |
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp |
index 1159ef3383fef5603d08bbf046a8a47e2cd9a446..34ef24bfe10713c4be18f90c0dc3da5e269bad2a 100644 |
--- a/src/core/SkWriteBuffer.cpp |
+++ b/src/core/SkWriteBuffer.cpp |
@@ -78,6 +78,19 @@ void SkBinaryWriteBuffer::writeColorArray(const SkColor* color, uint32_t count) |
fWriter.write(color, count * sizeof(SkColor)); |
} |
+static_assert(SK_SCALAR_IS_FLOAT, "Color4f serialization needs updating"); |
+void SkBinaryWriteBuffer::writeColor4f(const SkColor4f& color) { |
reed1
2016/09/13 23:18:07
I've bee using just write to make these simpler/fa
|
+ fWriter.writeScalar(color.fR); |
+ fWriter.writeScalar(color.fG); |
+ fWriter.writeScalar(color.fB); |
+ fWriter.writeScalar(color.fA); |
+} |
+ |
+void SkBinaryWriteBuffer::writeColor4fArray(const SkColor4f* color, uint32_t count) { |
+ fWriter.write32(count); |
+ fWriter.write(color, count * sizeof(SkColor4f)); |
+} |
+ |
void SkBinaryWriteBuffer::writePoint(const SkPoint& point) { |
fWriter.writeScalar(point.fX); |
fWriter.writeScalar(point.fY); |