diff options
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-27 20:39:19 +0000 |
---|---|---|
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-27 20:39:19 +0000 |
commit | 3cb969f27de56df0d9116c13f18bd31ee0715f1a (patch) | |
tree | 12ac8e97fc06bcdbe56d7cb4e7da29b0263eb8cb /include/pipe | |
parent | cc6e5efe03bfeda903d67d2bacd9ed0be58572ba (diff) |
In SkGPipe, only serialize SkTypefaces in cross process mode.
Also make SkGPipeController ref the recording canvas to ensure that
objects used by SkGPipeCanvas (e.g. SharedHeap and fTypefaceSet, which
hold references to objects to which pointers are written to the stream)
survive to be played back even if SkGPipeWriter.endRecording() is called.
BUG=
TEST=TypefaceGM
Review URL: https://codereview.appspot.com/6447055
git-svn-id: http://skia.googlecode.com/svn/trunk@4817 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/pipe')
-rw-r--r-- | include/pipe/SkGPipe.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/pipe/SkGPipe.h b/include/pipe/SkGPipe.h index d06148c662..a1f425c699 100644 --- a/include/pipe/SkGPipe.h +++ b/include/pipe/SkGPipe.h @@ -46,8 +46,13 @@ private: /////////////////////////////////////////////////////////////////////////////// +class SkGPipeCanvas; + class SkGPipeController { public: + SkGPipeController() : fCanvas(NULL) {} + virtual ~SkGPipeController(); + /** * Called periodically by the writer, to get a working buffer of RAM to * write into. The actual size of the block is also returned, and must be @@ -69,6 +74,12 @@ public: */ virtual void notifyWritten(size_t bytes) = 0; virtual int numberOfReaders() const { return 1; } + +private: + friend class SkGPipeWriter; + void setCanvas(SkGPipeCanvas*); + + SkGPipeCanvas* fCanvas; }; class SkGPipeWriter { @@ -116,9 +127,9 @@ public: size_t storageAllocatedForRecording(); private: - class SkGPipeCanvas* fCanvas; - SkFactorySet fFactorySet; - SkWriter32 fWriter; + SkGPipeCanvas* fCanvas; + SkFactorySet* fFactorySet; + SkWriter32 fWriter; }; #endif |