diff options
author | robertphillips <robertphillips@google.com> | 2014-11-11 04:54:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-11 04:54:49 -0800 |
commit | 81f71b6630a9b7398bf983689436cccdd8dd3ff7 (patch) | |
tree | 0c7f9ad995dd1ecd400af5da639c433fdda68f92 /include/core | |
parent | bffcb52ffe9b8bb4ae7f6eda0c55719d8e3be7b6 (diff) |
Change where layer hoisting data is gathered
This CL:
1) removes the EXPERIMENTAL_optimize on SkCanvas & SkDevice
2) moves the saveLayer gathering step to endRecording
3) Replaces GPUOptimize with SkRecordComputeLayers
4) Update bench_pictures & render_pictures to provide the new flag
#2 also necessitated moving the BBH computation (and record optimization) out of SkPicture's ctor (and into endRecording)
Review URL: https://codereview.chromium.org/718443002
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkCanvas.h | 8 | ||||
-rw-r--r-- | include/core/SkDevice.h | 6 | ||||
-rw-r--r-- | include/core/SkPictureRecorder.h | 7 |
3 files changed, 7 insertions, 14 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 4df523edef..2445c6e60d 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -996,14 +996,6 @@ public: */ void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint); - /** PRIVATE / EXPERIMENTAL -- do not call - Perform back-end analysis/optimization of a picture. This may attach - optimization data to the picture which can be used by a later - drawPicture call. - @param picture The recorded drawing commands to analyze/optimize - */ - void EXPERIMENTAL_optimize(const SkPicture* picture); - /** Draw the picture into this canvas. This method effective brackets the playback of the picture's draw calls with save/restore, so the state of this canvas will be unchanged after this call. diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 5984681622..4a61321ff7 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -327,12 +327,6 @@ protected: /** * PRIVATE / EXPERIMENTAL -- do not call - * Construct an acceleration object and attach it to 'picture' - */ - virtual void EXPERIMENTAL_optimize(const SkPicture* picture); - - /** - * PRIVATE / EXPERIMENTAL -- do not call * This entry point gives the backend an opportunity to take over the rendering * of 'picture'. If optimization data is available (due to an earlier * 'optimize' call) this entry point should make use of it and return true diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h index c48f35de6d..de216b4e5b 100644 --- a/include/core/SkPictureRecorder.h +++ b/include/core/SkPictureRecorder.h @@ -37,6 +37,12 @@ public: } #endif + enum RecordFlags { + // This flag indicates that, if some BHH is being computed, saveLayer + // information should also be extracted at the same time. + kComputeSaveLayerInfo_RecordFlag = 0x01 + }; + /** Returns the canvas that records the drawing commands. @param width the width of the cull rect used when recording this picture. @param height the height of the cull rect used when recording this picture. @@ -72,6 +78,7 @@ private: friend class SkPictureRecorderReplayTester; // for unit testing void partialReplay(SkCanvas* canvas) const; + uint32_t fFlags; SkScalar fCullWidth; SkScalar fCullHeight; SkAutoTUnref<SkBBoxHierarchy> fBBH; |