Apply color transform for Lattice fixed colors
This is fixing an issue with nine patch not drawing correctly
if there is a color transformaton.
Bug: b/69796044
Test: Ran lattice2 test for gbr-8888
Change-Id: Idadc2938222222750f0f8bfb12650569191b7ad9
Reviewed-on: https://skia-review.googlesource.com/83680
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/src/core/SkColorSpaceXformer.cpp b/src/core/SkColorSpaceXformer.cpp
index 58b3f49..14be534 100644
--- a/src/core/SkColorSpaceXformer.cpp
+++ b/src/core/SkColorSpaceXformer.cpp
@@ -176,3 +176,14 @@
return dst;
}
+
+SkCanvas::Lattice SkColorSpaceXformer::apply(const SkCanvas::Lattice& lattice,
+ SkColor* colorBuffer, int count) {
+ if (count) {
+ this->apply(colorBuffer, lattice.fColors, count);
+ return {lattice.fXDivs, lattice.fYDivs, lattice.fRectTypes,
+ lattice.fXCount, lattice.fYCount, lattice.fBounds, colorBuffer};
+ }
+
+ return lattice;
+}