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

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

Issue 1197283007: Fix memory leak in SkPictureRecord (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | 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 "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 19 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698