diff options
author | Romain Guy <romainguy@google.com> | 2010-12-09 17:47:21 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-12-09 17:47:21 -0800 |
commit | af636ebf5feb2837683fbfe965040cb706b32ec1 (patch) | |
tree | d0173871a1535d549cc1649daa2e1c2262671a52 /libs/hwui/Snapshot.h | |
parent | 3eb3106137aa23ceb19c5817fa43bbe545636430 (diff) | |
download | frameworks_base-af636ebf5feb2837683fbfe965040cb706b32ec1.zip frameworks_base-af636ebf5feb2837683fbfe965040cb706b32ec1.tar.gz frameworks_base-af636ebf5feb2837683fbfe965040cb706b32ec1.tar.bz2 |
Don't set the invisible flag when saving an empty layer.
Bug #3270371
Change-Id: I65e85671c2fb70d74553c91213e5e759e0ac64ee
Diffstat (limited to 'libs/hwui/Snapshot.h')
-rw-r--r-- | libs/hwui/Snapshot.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h index 9f78063..9898df4 100644 --- a/libs/hwui/Snapshot.h +++ b/libs/hwui/Snapshot.h @@ -43,7 +43,7 @@ namespace uirenderer { */ class Snapshot: public LightRefBase<Snapshot> { public: - Snapshot(): flags(0), previous(NULL), layer(NULL), fbo(0), invisible(false) { + Snapshot(): flags(0), previous(NULL), layer(NULL), fbo(0), invisible(false), empty(false) { transform = &mTransformRoot; clipRect = &mClipRectRoot; region = NULL; @@ -55,7 +55,7 @@ public: */ Snapshot(const sp<Snapshot>& s, int saveFlags): flags(0), previous(s), layer(NULL), fbo(s->fbo), - invisible(s->invisible), viewport(s->viewport), height(s->height) { + invisible(s->invisible), empty(false), viewport(s->viewport), height(s->height) { if (saveFlags & SkCanvas::kMatrix_SaveFlag) { mTransformRoot.load(*s->transform); transform = &mTransformRoot; @@ -203,6 +203,10 @@ public: flags |= Snapshot::kFlagClipSet | Snapshot::kFlagDirtyLocalClip; } + bool isIgnored() const { + return invisible || empty; + } + /** * Dirty flags. */ @@ -225,11 +229,18 @@ public: /** * Indicates that this snapshot is invisible and nothing should be drawn - * inside it. + * inside it. This flag is set only when the layer clips drawing to its + * bounds and is passed to subsequent snapshots. */ bool invisible; /** + * If set to true, the layer will not be composited. This is similar to + * invisible but this flag is not passed to subsequent snapshots. + */ + bool empty; + + /** * Current viewport. */ Rect viewport; |