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

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

Issue 1090943004: O(1) SkPictureUtils::ApproxBytesUsed() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: const Created 5 years, 8 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/SkPictureRecorder.cpp ('k') | src/core/SkRecorder.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 * 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 SkRecorder_DEFINED 8 #ifndef SkRecorder_DEFINED
9 #define SkRecorder_DEFINED 9 #define SkRecorder_DEFINED
10 10
(...skipping 23 matching lines...) Expand all
34 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. 34 // SkRecorder provides an SkCanvas interface for recording into an SkRecord.
35 35
36 class SkRecorder : public SkCanvas { 36 class SkRecorder : public SkCanvas {
37 public: 37 public:
38 // Does not take ownership of the SkRecord. 38 // Does not take ownership of the SkRecord.
39 SkRecorder(SkRecord*, int width, int height); // legacy version 39 SkRecorder(SkRecord*, int width, int height); // legacy version
40 SkRecorder(SkRecord*, const SkRect& bounds); 40 SkRecorder(SkRecord*, const SkRect& bounds);
41 41
42 void reset(SkRecord*, const SkRect& bounds); 42 void reset(SkRecord*, const SkRect& bounds);
43 43
44 size_t approxBytesUsedBySubPictures() const { return fApproxBytesUsedBySubPi ctures; }
45
44 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } 46 SkDrawableList* getDrawableList() const { return fDrawableList.get(); }
45 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } 47 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); }
46 48
47 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor der will fail. 49 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor der will fail.
48 void forgetRecord(); 50 void forgetRecord();
49 51
50 void willSave() override; 52 void willSave() override;
51 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav eFlags) override; 53 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav eFlags) override;
52 void willRestore() override {} 54 void willRestore() override {}
53 void didRestore() override; 55 void didRestore() override;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 126
125 template <typename T> 127 template <typename T>
126 T* copy(const T[], size_t count); 128 T* copy(const T[], size_t count);
127 129
128 SkIRect devBounds() const { 130 SkIRect devBounds() const {
129 SkIRect devBounds; 131 SkIRect devBounds;
130 this->getClipDeviceBounds(&devBounds); 132 this->getClipDeviceBounds(&devBounds);
131 return devBounds; 133 return devBounds;
132 } 134 }
133 135
136 size_t fApproxBytesUsedBySubPictures;
134 SkRecord* fRecord; 137 SkRecord* fRecord;
135
136 SkAutoTDelete<SkDrawableList> fDrawableList; 138 SkAutoTDelete<SkDrawableList> fDrawableList;
137 }; 139 };
138 140
139 #endif//SkRecorder_DEFINED 141 #endif//SkRecorder_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkPictureRecorder.cpp ('k') | src/core/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698