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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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 | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureImageGenerator.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkPictureFlat.h" 8 #include "SkPictureFlat.h"
9 9
10 #include "SkChecksum.h" 10 #include "SkChecksum.h"
(...skipping 11 matching lines...) Expand all
22 22
23 SkTypefacePlayback::~SkTypefacePlayback() { 23 SkTypefacePlayback::~SkTypefacePlayback() {
24 this->reset(NULL); 24 this->reset(NULL);
25 } 25 }
26 26
27 void SkTypefacePlayback::reset(const SkRefCntSet* rec) { 27 void SkTypefacePlayback::reset(const SkRefCntSet* rec) {
28 for (int i = 0; i < fCount; i++) { 28 for (int i = 0; i < fCount; i++) {
29 SkASSERT(fArray[i]); 29 SkASSERT(fArray[i]);
30 fArray[i]->unref(); 30 fArray[i]->unref();
31 } 31 }
32 SkDELETE_ARRAY(fArray); 32 delete[] fArray;
33 33
34 if (rec!= NULL && rec->count() > 0) { 34 if (rec!= NULL && rec->count() > 0) {
35 fCount = rec->count(); 35 fCount = rec->count();
36 fArray = SkNEW_ARRAY(SkRefCnt*, fCount); 36 fArray = new SkRefCnt* [fCount];
37 rec->copyToArray(fArray); 37 rec->copyToArray(fArray);
38 for (int i = 0; i < fCount; i++) { 38 for (int i = 0; i < fCount; i++) {
39 fArray[i]->ref(); 39 fArray[i]->ref();
40 } 40 }
41 } else { 41 } else {
42 fCount = 0; 42 fCount = 0;
43 fArray = NULL; 43 fArray = NULL;
44 } 44 }
45 } 45 }
46 46
47 void SkTypefacePlayback::setCount(int count) { 47 void SkTypefacePlayback::setCount(int count) {
48 this->reset(NULL); 48 this->reset(NULL);
49 49
50 fCount = count; 50 fCount = count;
51 fArray = SkNEW_ARRAY(SkRefCnt*, count); 51 fArray = new SkRefCnt* [count];
52 sk_bzero(fArray, count * sizeof(SkRefCnt*)); 52 sk_bzero(fArray, count * sizeof(SkRefCnt*));
53 } 53 }
54 54
55 SkRefCnt* SkTypefacePlayback::set(int index, SkRefCnt* obj) { 55 SkRefCnt* SkTypefacePlayback::set(int index, SkRefCnt* obj) {
56 SkASSERT((unsigned)index < (unsigned)fCount); 56 SkASSERT((unsigned)index < (unsigned)fCount);
57 SkRefCnt_SafeAssign(fArray[index], obj); 57 SkRefCnt_SafeAssign(fArray[index], obj);
58 return obj; 58 return obj;
59 } 59 }
60 60
61 /////////////////////////////////////////////////////////////////////////////// 61 ///////////////////////////////////////////////////////////////////////////////
(...skipping 20 matching lines...) Expand all
82 } 82 }
83 83
84 void SkFlatController::setTypefacePlayback(SkTypefacePlayback* playback) { 84 void SkFlatController::setTypefacePlayback(SkTypefacePlayback* playback) {
85 fTypefacePlayback = playback; 85 fTypefacePlayback = playback;
86 } 86 }
87 87
88 SkNamedFactorySet* SkFlatController::setNamedFactorySet(SkNamedFactorySet* set) { 88 SkNamedFactorySet* SkFlatController::setNamedFactorySet(SkNamedFactorySet* set) {
89 SkRefCnt_SafeAssign(fFactorySet, set); 89 SkRefCnt_SafeAssign(fFactorySet, set);
90 return set; 90 return set;
91 } 91 }
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698