| OLD | NEW |
| 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 "SkImage_Base.h" | 10 #include "SkImage_Base.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect
); | 30 static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect
); |
| 31 #endif//SK_DEBUG | 31 #endif//SK_DEBUG |
| 32 | 32 |
| 33 SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags) | 33 SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags) |
| 34 : INHERITED(dimensions.width(), dimensions.height()) | 34 : INHERITED(dimensions.width(), dimensions.height()) |
| 35 , fRecordFlags(flags) | 35 , fRecordFlags(flags) |
| 36 , fInitialSaveCount(kNoInitialSave) { | 36 , fInitialSaveCount(kNoInitialSave) { |
| 37 } | 37 } |
| 38 | 38 |
| 39 SkPictureRecord::~SkPictureRecord() { | 39 SkPictureRecord::~SkPictureRecord() { |
| 40 fImageRefs.unrefAll(); |
| 40 fPictureRefs.unrefAll(); | 41 fPictureRefs.unrefAll(); |
| 41 fTextBlobRefs.unrefAll(); | 42 fTextBlobRefs.unrefAll(); |
| 42 } | 43 } |
| 43 | 44 |
| 44 /////////////////////////////////////////////////////////////////////////////// | 45 /////////////////////////////////////////////////////////////////////////////// |
| 45 | 46 |
| 46 #ifdef SK_DEBUG | 47 #ifdef SK_DEBUG |
| 47 // Return the offset of the paint inside a given op's byte stream. A zero | 48 // Return the offset of the paint inside a given op's byte stream. A zero |
| 48 // return value means there is no paint (and you really shouldn't be calling | 49 // return value means there is no paint (and you really shouldn't be calling |
| 49 // this method) | 50 // this method) |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { | 1010 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { |
| 1010 int index = fTextBlobRefs.count(); | 1011 int index = fTextBlobRefs.count(); |
| 1011 *fTextBlobRefs.append() = blob; | 1012 *fTextBlobRefs.append() = blob; |
| 1012 blob->ref(); | 1013 blob->ref(); |
| 1013 // follow the convention of recording a 1-based index | 1014 // follow the convention of recording a 1-based index |
| 1014 this->addInt(index + 1); | 1015 this->addInt(index + 1); |
| 1015 } | 1016 } |
| 1016 | 1017 |
| 1017 /////////////////////////////////////////////////////////////////////////////// | 1018 /////////////////////////////////////////////////////////////////////////////// |
| 1018 | 1019 |
| OLD | NEW |