diff options
| author | Chris Craik <ccraik@google.com> | 2013-06-13 00:37:02 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-06-13 00:37:02 +0000 |
| commit | 149b015db9a478c6345cf0528fe4df3c7c2b5110 (patch) | |
| tree | 249c56eec7775891208a1c3ed0dc23ada71146c7 /libs/hwui/DeferredDisplayList.h | |
| parent | af0fa4fd739aae14733615b6ee9a6b9ca025c628 (diff) | |
| parent | 28ce94a4ffc7576f40776d212f1ada79fafaa061 (diff) | |
| download | frameworks_base-149b015db9a478c6345cf0528fe4df3c7c2b5110.zip frameworks_base-149b015db9a478c6345cf0528fe4df3c7c2b5110.tar.gz frameworks_base-149b015db9a478c6345cf0528fe4df3c7c2b5110.tar.bz2 | |
Merge "Overdraw avoidance and merging of clipped ops"
Diffstat (limited to 'libs/hwui/DeferredDisplayList.h')
| -rw-r--r-- | libs/hwui/DeferredDisplayList.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h index 9782c1c..7aa1672 100644 --- a/libs/hwui/DeferredDisplayList.h +++ b/libs/hwui/DeferredDisplayList.h @@ -44,8 +44,12 @@ typedef void* mergeid_t; class DeferredDisplayList { public: - DeferredDisplayList() { clear(); } + DeferredDisplayList(const Rect& bounds, bool avoidOverdraw = true) : + mBounds(bounds), mAvoidOverdraw(avoidOverdraw) { + clear(); + } ~DeferredDisplayList() { clear(); } + void reset(const Rect& bounds) { mBounds.set(bounds); } enum OpBatchId { kOpBatch_None = 0, // Don't batch @@ -96,6 +100,12 @@ private: int getStateOpDeferFlags() const; int getDrawOpDeferFlags() const; + void discardDrawingBatches(unsigned int maxIndex); + + // layer space bounds of rendering + Rect mBounds; + const bool mAvoidOverdraw; + /** * At defer time, stores the *defer time* savecount of save/saveLayer ops that were deferred, so * that when an associated restoreToCount is deferred, it can be recorded as a @@ -112,6 +122,9 @@ private: // Points to the index after the most recent barrier int mEarliestBatchIndex; + // Points to the first index that may contain a pure drawing batch + int mEarliestUnclearedIndex; + /** * Maps the mergeid_t returned by an op's getMergeId() to the most recently seen * MergingDrawBatch of that id. These ids are unique per draw type and guaranteed to not @@ -120,6 +133,24 @@ private: TinyHashMap<mergeid_t, DrawBatch*> mMergingBatches[kOpBatch_Count]; }; +/** + * Struct containing information that instructs the defer + */ +struct DeferInfo { +public: + DeferInfo() : + batchId(DeferredDisplayList::kOpBatch_None), + mergeId((mergeid_t) -1), + mergeable(false), + opaqueOverBounds(false) { + }; + + int batchId; + mergeid_t mergeId; + bool mergeable; + bool opaqueOverBounds; // opaque over bounds in DeferredDisplayState - can skip ops below +}; + }; // namespace uirenderer }; // namespace android |
