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

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

Issue 169023002: still trying to kill setDevice: rename to setRootDevice (better name) and make private (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } else { 132 } else {
133 SkASSERT(kSaveLayerWithBoundsSize == opSize); 133 SkASSERT(kSaveLayerWithBoundsSize == opSize);
134 return kSaveLayerWithBoundsPaintOffset + overflow; 134 return kSaveLayerWithBoundsPaintOffset + overflow;
135 } 135 }
136 } 136 }
137 137
138 SkASSERT(0 != gPaintOffsets[op]); // really shouldn't be calling this meth od 138 SkASSERT(0 != gPaintOffsets[op]); // really shouldn't be calling this meth od
139 return gPaintOffsets[op] * sizeof(uint32_t) + overflow; 139 return gPaintOffsets[op] * sizeof(uint32_t) + overflow;
140 } 140 }
141 141
142 SkBaseDevice* SkPictureRecord::setDevice(SkBaseDevice* device) {
143 SkDEBUGFAIL("eeek, don't try to change the device on a recording canvas");
144 return this->INHERITED::setDevice(device);
145 }
146
147 int SkPictureRecord::save(SaveFlags flags) { 142 int SkPictureRecord::save(SaveFlags flags) {
148 143
149 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 144 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
150 fMCMgr.save(flags); 145 fMCMgr.save(flags);
151 #else 146 #else
152 // record the offset to us, making it non-positive to distinguish a save 147 // record the offset to us, making it non-positive to distinguish a save
153 // from a clip entry. 148 // from a clip entry.
154 fRestoreOffsetStack.push(-(int32_t)fWriter.bytesWritten()); 149 fRestoreOffsetStack.push(-(int32_t)fWriter.bytesWritten());
155 this->recordSave(flags); 150 this->recordSave(flags);
156 #endif 151 #endif
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 void SkPictureRecord::validateRegions() const { 1773 void SkPictureRecord::validateRegions() const {
1779 int count = fRegions.count(); 1774 int count = fRegions.count();
1780 SkASSERT((unsigned) count < 0x1000); 1775 SkASSERT((unsigned) count < 0x1000);
1781 for (int index = 0; index < count; index++) { 1776 for (int index = 0; index < count; index++) {
1782 const SkFlatData* region = fRegions[index]; 1777 const SkFlatData* region = fRegions[index];
1783 SkASSERT(region); 1778 SkASSERT(region);
1784 // region->validate(); 1779 // region->validate();
1785 } 1780 }
1786 } 1781 }
1787 #endif 1782 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698