Allow SkPicture-derived classes install their own SkPicturePlayback-derived object

https://codereview.appspot.com/6851048/



git-svn-id: http://skia.googlecode.com/svn/trunk@6405 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-11-13 20:41:18 +00:00
parent 71f0f34f7d
commit 9a5b570e5c
2 changed files with 15 additions and 15 deletions

View File

@ -149,9 +149,21 @@ public:
void abortPlayback();
protected:
// fRecord and fWidth & fHeight are protected to allow derived classes to
// install their own SkPictureRecord-derived recorders and set the picture
// size
// V2 : adds SkPixelRef's generation ID.
// V3 : PictInfo tag at beginning, and EOF tag at the end
// V4 : move SkPictInfo to be the header
// V5 : don't read/write FunctionPtr on cross-process (we can detect that)
// V6 : added serialization of SkPath's bounds (and packed its flags tighter)
// V7 : changed drawBitmapRect(IRect) to drawBitmapRectToRect(Rect)
// V8 : Add an option for encoding bitmaps
// V9 : Allow the reader and writer of an SKP disagree on whether to support
// SK_SUPPORT_HINTING_SCALE_FACTOR
static const int PICTURE_VERSION = 9;
// fPlayback, fRecord, fWidth & fHeight are protected to allow derived classes to
// install their own SkPicturePlayback-derived players,SkPictureRecord-derived
// recorders and set the picture size
SkPicturePlayback* fPlayback;
SkPictureRecord* fRecord;
int fWidth, fHeight;
@ -160,7 +172,6 @@ protected:
virtual SkBBoxHierarchy* createBBoxHierarchy() const;
private:
SkPicturePlayback* fPlayback;
friend class SkFlatPicture;
friend class SkPicturePlayback;

View File

@ -253,17 +253,6 @@ void SkPicture::draw(SkCanvas* surface) {
#include "SkStream.h"
// V2 : adds SkPixelRef's generation ID.
// V3 : PictInfo tag at beginning, and EOF tag at the end
// V4 : move SkPictInfo to be the header
// V5 : don't read/write FunctionPtr on cross-process (we can detect that)
// V6 : added serialization of SkPath's bounds (and packed its flags tighter)
// V7 : changed drawBitmapRect(IRect) to drawBitmapRectToRect(Rect)
// V8 : Add an option for encoding bitmaps
// V9 : Allow the reader and writer of an SKP disagree on whether to support
// SK_SUPPORT_HINTING_SCALE_FACTOR
#define PICTURE_VERSION 9
SkPicture::SkPicture(SkStream* stream, bool* success, SkSerializationHelpers::DecodeBitmap decoder) : SkRefCnt() {
if (success) {
*success = false;