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

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

Issue 803913005: Remove SkCanvas::isDrawingToLayer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: moar cleanup Created 6 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
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 "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 size_t initialOffset = this->addDraw(SAVE_LAYER, &size); 181 size_t initialOffset = this->addDraw(SAVE_LAYER, &size);
182 this->addRectPtr(bounds); 182 this->addRectPtr(bounds);
183 SkASSERT(initialOffset+get_paint_offset(SAVE_LAYER, size) == fWriter.bytesWr itten()); 183 SkASSERT(initialOffset+get_paint_offset(SAVE_LAYER, size) == fWriter.bytesWr itten());
184 this->addPaintPtr(paint); 184 this->addPaintPtr(paint);
185 this->addInt(flags); 185 this->addInt(flags);
186 186
187 this->validate(initialOffset, size); 187 this->validate(initialOffset, size);
188 } 188 }
189 189
190 bool SkPictureRecord::isDrawingToLayer() const {
191 return fFirstSavedLayerIndex != kNoSavedLayerIndex;
mtklein 2014/12/15 17:33:34 Also clean up fFirstSaveLayerIndex / kNoSavedLayer
192 }
193
194 #ifdef SK_DEBUG 190 #ifdef SK_DEBUG
195 /* 191 /*
196 * Read the op code from 'offset' in 'writer' and extract the size too. 192 * Read the op code from 'offset' in 'writer' and extract the size too.
197 */ 193 */
198 static DrawType peek_op_and_size(SkWriter32* writer, size_t offset, uint32_t* si ze) { 194 static DrawType peek_op_and_size(SkWriter32* writer, size_t offset, uint32_t* si ze) {
199 uint32_t peek = writer->readTAt<uint32_t>(offset); 195 uint32_t peek = writer->readTAt<uint32_t>(offset);
200 196
201 uint32_t op; 197 uint32_t op;
202 UNPACK_8_24(peek, op, *size); 198 UNPACK_8_24(peek, op, *size);
203 if (MASK_24 == *size) { 199 if (MASK_24 == *size) {
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { 1009 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) {
1014 int index = fTextBlobRefs.count(); 1010 int index = fTextBlobRefs.count();
1015 *fTextBlobRefs.append() = blob; 1011 *fTextBlobRefs.append() = blob;
1016 blob->ref(); 1012 blob->ref();
1017 // follow the convention of recording a 1-based index 1013 // follow the convention of recording a 1-based index
1018 this->addInt(index + 1); 1014 this->addInt(index + 1);
1019 } 1015 }
1020 1016
1021 /////////////////////////////////////////////////////////////////////////////// 1017 ///////////////////////////////////////////////////////////////////////////////
1022 1018
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698