Change SkColor4f to RGBA channel order
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2093763003
Review-Url: https://codereview.chromium.org/2093763003
diff --git a/src/core/SkColorShader.cpp b/src/core/SkColorShader.cpp
index 250a367..c610816 100644
--- a/src/core/SkColorShader.cpp
+++ b/src/core/SkColorShader.cpp
@@ -133,10 +133,10 @@
sk_sp<SkFlattenable> SkColor4Shader::CreateProc(SkReadBuffer& buffer) {
SkColor4f color;
- color.fA = buffer.readScalar(); // readFloat()
- color.fR = buffer.readScalar();
+ color.fR = buffer.readScalar(); // readFloat()
color.fG = buffer.readScalar();
color.fB = buffer.readScalar();
+ color.fA = buffer.readScalar();
if (buffer.readBool()) {
// TODO how do we unflatten colorspaces
}
@@ -144,10 +144,10 @@
}
void SkColor4Shader::flatten(SkWriteBuffer& buffer) const {
- buffer.writeScalar(fColor4.fA); // writeFloat()
- buffer.writeScalar(fColor4.fR);
+ buffer.writeScalar(fColor4.fR); // writeFloat()
buffer.writeScalar(fColor4.fG);
buffer.writeScalar(fColor4.fB);
+ buffer.writeScalar(fColor4.fA);
buffer.writeBool(false); // TODO how do we flatten colorspaces?
}
@@ -232,7 +232,7 @@
void SkColor4Shader::toString(SkString* str) const {
str->append("SkColor4Shader: (");
- str->append("ARGB:");
+ str->append("RGBA:");
for (int i = 0; i < 4; ++i) {
str->appendf(" %g", fColor4.vec()[i]);
}