Add option in flattening to write factory names inline, as we are recording.
SkGPipe needs this, since it cannot (unlike SkPicture) see all of the factories
before it hands its data to the reader.
In this mode, the writer embedds the factory name the first time it sees it,
and then after that writes an index (referencing the fFactorySet). The reader
installs an empty array, and as it encounters names, appends them to that array
so that subsequent indices can be used to retrieve the previously named factory.
Some of the existing patheffects did not register their factory names, so those
changes are also part of this CL. Annoyingly, to register your factory using the
current scheme, it has to be in the public section of the class definition.
git-svn-id: http://skia.googlecode.com/svn/trunk@1663 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/effects/SkDashPathEffect.h b/include/effects/SkDashPathEffect.h
index 145f67d..4eb5c1e 100644
--- a/include/effects/SkDashPathEffect.h
+++ b/include/effects/SkDashPathEffect.h
@@ -44,6 +44,8 @@
// This method is not exported to java.
virtual void flatten(SkFlattenableWriteBuffer&);
+ static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
+
protected:
SkDashPathEffect(SkFlattenableReadBuffer&);
@@ -56,8 +58,6 @@
SkScalar fIntervalLength;
bool fScaleToFit;
- static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
-
typedef SkPathEffect INHERITED;
};