Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/core/SkClipStack.cpp

Issue 115573005: Avoid some work on SkClipStack equality when the topmost genids match (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkClipStack.h" 8 #include "SkClipStack.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 #include "SkThread.h" 10 #include "SkThread.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 for (const Element* element = (const Element*)recIter.next(); 399 for (const Element* element = (const Element*)recIter.next();
400 element != NULL; 400 element != NULL;
401 element = (const Element*)recIter.next()) { 401 element = (const Element*)recIter.next()) {
402 new (fDeque.push_back()) Element(*element); 402 new (fDeque.push_back()) Element(*element);
403 } 403 }
404 404
405 return *this; 405 return *this;
406 } 406 }
407 407
408 bool SkClipStack::operator==(const SkClipStack& b) const { 408 bool SkClipStack::operator==(const SkClipStack& b) const {
409 if (this->getTopmostGenID() == b.getTopmostGenID()) {
410 return true;
411 }
409 if (fSaveCount != b.fSaveCount || 412 if (fSaveCount != b.fSaveCount ||
410 fDeque.count() != b.fDeque.count()) { 413 fDeque.count() != b.fDeque.count()) {
411 return false; 414 return false;
412 } 415 }
413 SkDeque::F2BIter myIter(fDeque); 416 SkDeque::F2BIter myIter(fDeque);
414 SkDeque::F2BIter bIter(b.fDeque); 417 SkDeque::F2BIter bIter(b.fDeque);
415 const Element* myElement = (const Element*)myIter.next(); 418 const Element* myElement = (const Element*)myIter.next();
416 const Element* bElement = (const Element*)bIter.next(); 419 const Element* bElement = (const Element*)bIter.next();
417 420
418 while (myElement != NULL && bElement != NULL) { 421 while (myElement != NULL && bElement != NULL) {
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 return kWideOpenGenID; 730 return kWideOpenGenID;
728 } 731 }
729 732
730 const Element* back = static_cast<const Element*>(fDeque.back()); 733 const Element* back = static_cast<const Element*>(fDeque.back());
731 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is Empty()) { 734 if (kInsideOut_BoundsType == back->fFiniteBoundType && back->fFiniteBound.is Empty()) {
732 return kWideOpenGenID; 735 return kWideOpenGenID;
733 } 736 }
734 737
735 return back->getGenID(); 738 return back->getGenID();
736 } 739 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698