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

Unified Diff: src/effects/SkTableColorFilter.cpp

Issue 768183002: Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/effects/SkRectShaderImageFilter.cpp ('k') | src/effects/SkTableMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/effects/SkRectShaderImageFilter.cpp ('k') | src/effects/SkTableMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698