Index: src/effects/SkTableColorFilter.cpp |
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp |
index 7cd628fd2d08b3ba35071777a75b9073ab450566..c3c2ba067b8fd6f8ca65074d4804fbfd1ab69d9f 100644 |
--- a/src/effects/SkTableColorFilter.cpp |
+++ b/src/effects/SkTableColorFilter.cpp |
@@ -61,6 +61,9 @@ |
}; |
protected: |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
+ SkTable_ColorFilter(SkReadBuffer& buffer); |
+#endif |
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
private: |
@@ -224,6 +227,27 @@ |
return SkTableColorFilter::CreateARGB(a, r, g, b); |
} |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
+SkTable_ColorFilter::SkTable_ColorFilter(SkReadBuffer& buffer) : INHERITED(buffer) { |
+ fBitmap = NULL; |
+ |
+ uint8_t storage[5*256]; |
+ |
+ fFlags = buffer.readInt(); |
+ |
+ size_t size = buffer.getArrayCount(); |
+ SkASSERT(size <= sizeof(storage)); |
+ buffer.validate(size <= sizeof(storage)); |
+ buffer.readByteArray(storage, size); |
+ |
+ SkDEBUGCODE(size_t raw = ) SkPackBits::Unpack8(storage, size, fStorage); |
+ |
+ SkASSERT(raw <= sizeof(fStorage)); |
+ SkDEBUGCODE(size_t count = gCountNibBits[fFlags & 0xF]); |
+ SkASSERT(raw == count * 256); |
+} |
+#endif |
+ |
bool SkTable_ColorFilter::asComponentTable(SkBitmap* table) const { |
if (table) { |
if (NULL == fBitmap) { |
@@ -288,7 +312,7 @@ |
GrTextureAccess fTextureAccess; |
// currently not used in shader code, just to assist onComputeInvariantOutput(). |
- unsigned fFlags; |
+ unsigned fFlags; |
GrTextureStripAtlas* fAtlas; |
int fRow; |
@@ -334,7 +358,7 @@ |
rgbaYValues[3] = 0.125; |
rgbaYValues[0] = 0.375; |
rgbaYValues[1] = 0.625; |
- rgbaYValues[2] = 0.875; |
+ rgbaYValues[2] = 0.875; |
} |
pdm.set4fv(fRGBAYValuesUni, 1, rgbaYValues); |
} |