From 73e71023a05393ef0aa12bf3644a1c704feeec0c Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Thu, 9 Aug 2012 18:10:49 +0000 Subject: Added method of getting top genID from SkClipStack http://codereview.appspot.com/6446108/ git-svn-id: http://skia.googlecode.com/svn/trunk@5034 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkClipStack.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core') diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp index 25e8ced29c..ff771c1cbe 100644 --- a/src/core/SkClipStack.cpp +++ b/src/core/SkClipStack.cpp @@ -690,6 +690,7 @@ const SkClipStack::Iter::Clip* SkClipStack::Iter::updateClip( } fClip.fOp = rec->fOp; fClip.fDoAA = rec->fDoAA; + fClip.fGenID = rec->fGenID; return &fClip; } @@ -812,3 +813,13 @@ void SkClipStack::purgeClip(Rec* rec) { int32_t SkClipStack::GetNextGenID() { return sk_atomic_inc(&gGenID); } + +int32_t SkClipStack::getTopmostGenID() const { + + if (fDeque.empty()) { + return kInvalidGenID; + } + + Rec* rec = (Rec*)fDeque.back(); + return rec->fGenID; +} -- cgit v1.2.3