diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-18 17:45:32 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-18 17:45:32 +0000 |
commit | 70512af9dd7a6b2c0a3f5971fd6e103dc577a400 (patch) | |
tree | 7f3fb32dc797eb3841ec2597e7ec3feb3b615ebe /src/core/SkPicturePlayback.h | |
parent | af5346a39cf2412eeb2da7339a51e44ae68dd677 (diff) |
Add a means of extracting active operations from SkPicture
For the "pull forward" task I will be comparing the two cases:
analyze the whole skp and use the BBH information
analyze only the active portion of the skp
In the first case we need a way to get the BBH information out of the picture in order to extract the relevant portions of the whole-skp analysis. This adds caching of the active ops so that work isn't duplicated between when the optimization path queries for that information and when the usual draw path queries for it.
Committed: http://code.google.com/p/skia/source/detail?r=13836
R=reed@google.com, bsalomon@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/195793010
git-svn-id: http://skia.googlecode.com/svn/trunk@13853 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPicturePlayback.h')
-rw-r--r-- | src/core/SkPicturePlayback.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/core/SkPicturePlayback.h b/src/core/SkPicturePlayback.h index 512f24a77e..11624205d4 100644 --- a/src/core/SkPicturePlayback.h +++ b/src/core/SkPicturePlayback.h @@ -85,6 +85,8 @@ public: virtual ~SkPicturePlayback(); + const SkPicture::OperationList& getActiveOps(const SkIRect& queryRect); + void draw(SkCanvas& canvas, SkDrawPictureCallback*); void serialize(SkWStream*, SkPicture::EncodeBitmap) const; @@ -109,7 +111,7 @@ protected: virtual void postDraw(int opIndex); #endif - void preLoadBitmaps(const SkTDArray<void*>& results); + void preLoadBitmaps(const SkTDArray<void*>* results); private: class TextContainer { @@ -237,6 +239,29 @@ private: SkBBoxHierarchy* fBoundingHierarchy; SkPictureStateTree* fStateTree; + class CachedOperationList : public SkPicture::OperationList { + public: + CachedOperationList() { + fCacheQueryRect.setEmpty(); + } + + virtual bool valid() const { return true; } + virtual int numOps() const SK_OVERRIDE { return fOps.count(); } + virtual uint32_t offset(int index) const SK_OVERRIDE; + virtual const SkMatrix& matrix(int index) const SK_OVERRIDE; + + // The query rect for which the cached active ops are valid + SkIRect fCacheQueryRect; + + // The operations which are active within 'fCachedQueryRect' + SkTDArray<void*> fOps; + + private: + typedef SkPicture::OperationList INHERITED; + }; + + CachedOperationList* fCachedActiveOps; + SkTypefacePlayback fTFPlayback; SkFactoryPlayback* fFactoryPlayback; #ifdef SK_BUILD_FOR_ANDROID |