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

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

Issue 250733007: Revert of Refactor SkPictureStateTree::Iterator to avoid use of kClip_SaveFlag. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 months 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 | src/core/SkPictureStateTree.h » ('j') | 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include <new> 7 #include <new>
8 #include "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkPicturePlayback.h" 9 #include "SkPicturePlayback.h"
10 #include "SkPictureRecord.h" 10 #include "SkPictureRecord.h"
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 activeOps = &((const CachedOperationList&)activeOpsList).fOps; 852 activeOps = &((const CachedOperationList&)activeOpsList).fOps;
853 } 853 }
854 } 854 }
855 } 855 }
856 856
857 SkPictureStateTree::Iterator it = (NULL == activeOps) ? 857 SkPictureStateTree::Iterator it = (NULL == activeOps) ?
858 SkPictureStateTree::Iterator() : 858 SkPictureStateTree::Iterator() :
859 fStateTree->getIterator(*activeOps, &canvas); 859 fStateTree->getIterator(*activeOps, &canvas);
860 860
861 if (it.isValid()) { 861 if (it.isValid()) {
862 uint32_t skipTo = it.nextDraw(); 862 uint32_t skipTo = it.draw();
863 if (kDrawComplete == skipTo) { 863 if (kDrawComplete == skipTo) {
864 return; 864 return;
865 } 865 }
866 reader.setOffset(skipTo); 866 reader.setOffset(skipTo);
867 } 867 }
868 868
869 // Record this, so we can concat w/ it if we encounter a setMatrix() 869 // Record this, so we can concat w/ it if we encounter a setMatrix()
870 SkMatrix initialMatrix = canvas.getTotalMatrix(); 870 SkMatrix initialMatrix = canvas.getTotalMatrix();
871 int originalSaveCount = canvas.getSaveCount(); 871 int originalSaveCount = canvas.getSaveCount();
872 872
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 } 908 }
909 #endif 909 #endif
910 } 910 }
911 911
912 if (0 != skipTo) { 912 if (0 != skipTo) {
913 if (it.isValid()) { 913 if (it.isValid()) {
914 // If using a bounding box hierarchy, advance the state tree 914 // If using a bounding box hierarchy, advance the state tree
915 // iterator until at or after skipTo 915 // iterator until at or after skipTo
916 uint32_t adjustedSkipTo; 916 uint32_t adjustedSkipTo;
917 do { 917 do {
918 adjustedSkipTo = it.nextDraw(); 918 adjustedSkipTo = it.draw();
919 } while (adjustedSkipTo < skipTo); 919 } while (adjustedSkipTo < skipTo);
920 skipTo = adjustedSkipTo; 920 skipTo = adjustedSkipTo;
921 } 921 }
922 if (kDrawComplete == skipTo) { 922 if (kDrawComplete == skipTo) {
923 break; 923 break;
924 } 924 }
925 reader.setOffset(skipTo); 925 reader.setOffset(skipTo);
926 continue; 926 continue;
927 } 927 }
928 928
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 } break; 1247 } break;
1248 default: 1248 default:
1249 SkASSERT(0); 1249 SkASSERT(0);
1250 } 1250 }
1251 1251
1252 #ifdef SK_DEVELOPER 1252 #ifdef SK_DEVELOPER
1253 this->postDraw(opIndex); 1253 this->postDraw(opIndex);
1254 #endif 1254 #endif
1255 1255
1256 if (it.isValid()) { 1256 if (it.isValid()) {
1257 uint32_t skipTo = it.nextDraw(); 1257 uint32_t skipTo = it.draw();
1258 if (kDrawComplete == skipTo) { 1258 if (kDrawComplete == skipTo) {
1259 break; 1259 break;
1260 } 1260 }
1261 reader.setOffset(skipTo); 1261 reader.setOffset(skipTo);
1262 } 1262 }
1263 } 1263 }
1264 1264
1265 #ifdef SPEW_CLIP_SKIPPING 1265 #ifdef SPEW_CLIP_SKIPPING
1266 { 1266 {
1267 size_t size = skipRect.fSize + skipRRect.fSize + skipPath.fSize + skipR egion.fSize + 1267 size_t size = skipRect.fSize + skipRRect.fSize + skipPath.fSize + skipR egion.fSize +
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 for (index = 0; index < fPictureCount; index++) 1779 for (index = 0; index < fPictureCount; index++)
1780 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1780 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1781 "picture%p, ", fPictureRefs[index]); 1781 "picture%p, ", fPictureRefs[index]);
1782 if (fPictureCount > 0) 1782 if (fPictureCount > 0)
1783 SkDebugf("%s0};\n", pBuffer); 1783 SkDebugf("%s0};\n", pBuffer);
1784 1784
1785 const_cast<SkPicturePlayback*>(this)->dumpStream(); 1785 const_cast<SkPicturePlayback*>(this)->dumpStream();
1786 } 1786 }
1787 1787
1788 #endif 1788 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPictureStateTree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698