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

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

Issue 241453003: Reduce internal explicit SaveFlags usage. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Re-added needed save flag in SkPictureStateTree::Iterator::draw() 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 | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureStateTree.cpp » ('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 7
8 #include "SkPictureRecord.h" 8 #include "SkPictureRecord.h"
9 #include "SkTSearch.h" 9 #include "SkTSearch.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 DrawType drawOp = peek_op_and_size(&fWriter, -offset, &opSize); 763 DrawType drawOp = peek_op_and_size(&fWriter, -offset, &opSize);
764 SkASSERT(SAVE == drawOp || SAVE_LAYER == drawOp); 764 SkASSERT(SAVE == drawOp || SAVE_LAYER == drawOp);
765 #endif 765 #endif
766 } 766 }
767 #endif 767 #endif
768 768
769 void SkPictureRecord::beginRecording() { 769 void SkPictureRecord::beginRecording() {
770 // we have to call this *after* our constructor, to ensure that it gets 770 // we have to call this *after* our constructor, to ensure that it gets
771 // recorded. This is balanced by restoreToCount() call from endRecording, 771 // recorded. This is balanced by restoreToCount() call from endRecording,
772 // which in-turn calls our overridden restore(), so those get recorded too. 772 // which in-turn calls our overridden restore(), so those get recorded too.
773 fInitialSaveCount = this->save(kMatrixClip_SaveFlag); 773 fInitialSaveCount = this->save();
774 } 774 }
775 775
776 void SkPictureRecord::endRecording() { 776 void SkPictureRecord::endRecording() {
777 SkASSERT(kNoInitialSave != fInitialSaveCount); 777 SkASSERT(kNoInitialSave != fInitialSaveCount);
778 this->restoreToCount(fInitialSaveCount); 778 this->restoreToCount(fInitialSaveCount);
779 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 779 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
780 fMCMgr.finish(); 780 fMCMgr.finish();
781 #endif 781 #endif
782 } 782 }
783 783
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1814 void SkPictureRecord::validateRegions() const { 1814 void SkPictureRecord::validateRegions() const {
1815 int count = fRegions.count(); 1815 int count = fRegions.count();
1816 SkASSERT((unsigned) count < 0x1000); 1816 SkASSERT((unsigned) count < 0x1000);
1817 for (int index = 0; index < count; index++) { 1817 for (int index = 0; index < count; index++) {
1818 const SkFlatData* region = fRegions[index]; 1818 const SkFlatData* region = fRegions[index];
1819 SkASSERT(region); 1819 SkASSERT(region);
1820 // region->validate(); 1820 // region->validate();
1821 } 1821 }
1822 } 1822 }
1823 #endif 1823 #endif
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureStateTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698