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

Unified Diff: src/effects/SkLerpXfermode.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 months 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/SkLayerRasterizer.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLerpXfermode.cpp
diff --git a/src/effects/SkLerpXfermode.cpp b/src/effects/SkLerpXfermode.cpp
index c8389fea799c7fe5181cb065410dd5785134fb39..0376a57b64f0a2921d707123a11af1883413ab00 100644
--- a/src/effects/SkLerpXfermode.cpp
+++ b/src/effects/SkLerpXfermode.cpp
@@ -23,16 +23,20 @@ SkXfermode* SkLerpXfermode::Create(SkScalar scale) {
SkLerpXfermode::SkLerpXfermode(unsigned scale256) : fScale256(scale256) {}
-SkLerpXfermode::SkLerpXfermode(SkReadBuffer& buffer)
- : INHERITED(buffer) {
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
+SkLerpXfermode::SkLerpXfermode(SkReadBuffer& buffer) : INHERITED(buffer) {
fScale256 = buffer.readUInt();
}
+#endif
void SkLerpXfermode::flatten(SkWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
buffer.writeUInt(fScale256);
}
+SkFlattenable* SkLerpXfermode::CreateProc(SkReadBuffer& buffer) {
+ return SkNEW_ARGS(SkLerpXfermode, (buffer.readUInt()));
+}
+
void SkLerpXfermode::xfer32(SkPMColor dst[], const SkPMColor src[], int count,
const SkAlpha aa[]) const {
const int scale = fScale256;
« no previous file with comments | « src/effects/SkLayerRasterizer.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698