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

Side by Side Diff: src/core/SkLayerInfo.h

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/SkImageGeneratorPriv.h ('k') | src/core/SkLightingShader.h » ('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 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 #ifndef SkLayerInfo_DEFINED 8 #ifndef SkLayerInfo_DEFINED
9 #define SkLayerInfo_DEFINED 9 #define SkLayerInfo_DEFINED
10 10
11 #include "SkBigPicture.h" 11 #include "SkBigPicture.h"
12 #include "SkTArray.h" 12 #include "SkTArray.h"
13 13
14 // This class stores information about the saveLayer/restore pairs found 14 // This class stores information about the saveLayer/restore pairs found
15 // within an SkPicture. It is used by Ganesh to perform layer hoisting. 15 // within an SkPicture. It is used by Ganesh to perform layer hoisting.
16 class SkLayerInfo : public SkBigPicture::AccelData { 16 class SkLayerInfo : public SkBigPicture::AccelData {
17 public: 17 public:
18 // Information about a given saveLayer/restore block in an SkPicture 18 // Information about a given saveLayer/restore block in an SkPicture
19 class BlockInfo { 19 class BlockInfo {
20 public: 20 public:
21 BlockInfo() : fPicture(NULL), fPaint(NULL), fKey(NULL), fKeySize(0) {} 21 BlockInfo() : fPicture(NULL), fPaint(NULL), fKey(NULL), fKeySize(0) {}
22 ~BlockInfo() { SkSafeUnref(fPicture); SkDELETE(fPaint); SkDELETE_ARRAY(f Key); } 22 ~BlockInfo() {
23 SkSafeUnref(fPicture);
24 delete fPaint;
25 delete[] fKey;
26 }
23 27
24 // The picture owning the layer. If the owning picture is the top-most 28 // The picture owning the layer. If the owning picture is the top-most
25 // one (i.e., the picture for which this SkLayerInfo was created) then 29 // one (i.e., the picture for which this SkLayerInfo was created) then
26 // this pointer is NULL. If it is a nested picture then the pointer 30 // this pointer is NULL. If it is a nested picture then the pointer
27 // is non-NULL and owns a ref on the picture. 31 // is non-NULL and owns a ref on the picture.
28 const SkPicture* fPicture; 32 const SkPicture* fPicture;
29 // The device space bounds of this layer. 33 // The device space bounds of this layer.
30 SkRect fBounds; 34 SkRect fBounds;
31 // If not-empty, the optional bounds parameter passed in to the saveLaye r 35 // If not-empty, the optional bounds parameter passed in to the saveLaye r
32 // call. 36 // call.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return fBlocks[index]; 76 return fBlocks[index];
73 } 77 }
74 78
75 private: 79 private:
76 SkTArray<BlockInfo, true> fBlocks; 80 SkTArray<BlockInfo, true> fBlocks;
77 81
78 typedef SkBigPicture::AccelData INHERITED; 82 typedef SkBigPicture::AccelData INHERITED;
79 }; 83 };
80 84
81 #endif // SkLayerInfo_DEFINED 85 #endif // SkLayerInfo_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkImageGeneratorPriv.h ('k') | src/core/SkLightingShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698