Add option in flattening to write factory names inline, as we are recording.
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 21 Jun 2011 19:24:00 +0000 (19:24 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 21 Jun 2011 19:24:00 +0000 (19:24 +0000)
commit6bac947cd5bc460dd9166ada6310d678fd2e39f8
tree4f0adb7306dc1738f7e935ad84aac16ea1cc5d4d
parent25fb21f5df904c6f111bbf8f07e6a6c339416d09
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
17 files changed:
include/core/SkFlattenable.h
include/core/SkPaint.h
include/core/SkPathEffect.h
include/core/SkPtrRecorder.h
include/effects/SkCornerPathEffect.h
include/effects/SkDashPathEffect.h
include/effects/SkDiscretePathEffect.h
src/core/SkFlattenable.cpp
src/core/SkPathEffect.cpp
src/core/SkWriter32.cpp
src/effects/SkBlurDrawLooper.cpp
src/effects/SkCornerPathEffect.cpp
src/effects/SkDashPathEffect.cpp
src/effects/SkDiscretePathEffect.cpp
src/pipe/SkGPipePriv.h
src/pipe/SkGPipeRead.cpp
src/pipe/SkGPipeWrite.cpp