diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-21 19:24:00 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-21 19:24:00 +0000 |
commit | 6bac947cd5bc460dd9166ada6310d678fd2e39f8 (patch) | |
tree | 4f0adb7306dc1738f7e935ad84aac16ea1cc5d4d /src/effects/SkDiscretePathEffect.cpp | |
parent | 25fb21f5df904c6f111bbf8f07e6a6c339416d09 (diff) |
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
Diffstat (limited to 'src/effects/SkDiscretePathEffect.cpp')
-rw-r--r-- | src/effects/SkDiscretePathEffect.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp index 3b8d48e7b5..9ffce896af 100644 --- a/src/effects/SkDiscretePathEffect.cpp +++ b/src/effects/SkDiscretePathEffect.cpp @@ -93,3 +93,8 @@ SkDiscretePathEffect::SkDiscretePathEffect(SkFlattenableReadBuffer& buffer) { fPerterb = buffer.readScalar(); } +/////////////////////////////////////////////////////////////////////////////// + +static SkFlattenable::Registrar gReg("SkDiscretePathEffect", + SkDiscretePathEffect::CreateProc); + |