Avoid some work on SkClipStack equality when the topmost genids match
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 6 Jan 2014 16:54:20 +0000 (16:54 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 6 Jan 2014 16:54:20 +0000 (16:54 +0000)
Two clip stacks are defined being equal if the topmost genids match.

R=bsalomon@google.com

Author: kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/115573005

git-svn-id: http://skia.googlecode.com/svn/trunk@12909 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkClipStack.cpp

index 53a8888..c66a219 100644 (file)
@@ -406,6 +406,9 @@ SkClipStack& SkClipStack::operator=(const SkClipStack& b) {
 }
 
 bool SkClipStack::operator==(const SkClipStack& b) const {
+    if (this->getTopmostGenID() == b.getTopmostGenID()) {
+        return true;
+    }
     if (fSaveCount != b.fSaveCount ||
         fDeque.count() != b.fDeque.count()) {
         return false;