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

Unified Diff: include/core/SkPicture.h

Issue 324293004: Remove picture pre-allocation from SkPictureRecorder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix initializer list order Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkPictureRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 82c78a7880070073f5d18daac597f40b99baadd2..0b6261af4e9b6e8f53d0164cf5a7ff760ef8bf74 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -286,73 +286,11 @@ protected:
// playback is unchanged.
SkPicture(SkPicturePlayback*, int width, int height);
-private:
- friend class SkPictureRecord;
- friend class SkPictureTester; // for unit testing
+ SkPicture(int width, int height, SkPictureRecord& record, bool deepCopyOps);
+private:
SkAutoTUnref<SkPathHeap> fPathHeap; // reference counted
- // ContentInfo is not serialized! It is intended solely for use
- // with suitableForGpuRasterization.
- class ContentInfo {
- public:
- ContentInfo() { this->reset(); }
-
- ContentInfo(const ContentInfo& src) { this->set(src); }
-
- void set(const ContentInfo& src) {
- fNumPaintWithPathEffectUses = src.fNumPaintWithPathEffectUses;
- fNumAAConcavePaths = src.fNumAAConcavePaths;
- fNumAAHairlineConcavePaths = src.fNumAAHairlineConcavePaths;
- }
-
- void reset() {
- fNumPaintWithPathEffectUses = 0;
- fNumAAConcavePaths = 0;
- fNumAAHairlineConcavePaths = 0;
- }
-
- void swap(ContentInfo* other) {
- SkTSwap(fNumPaintWithPathEffectUses, other->fNumPaintWithPathEffectUses);
- SkTSwap(fNumAAConcavePaths, other->fNumAAConcavePaths);
- SkTSwap(fNumAAHairlineConcavePaths, other->fNumAAHairlineConcavePaths);
- }
-
- // This field is incremented every time a paint with a path effect is
- // used (i.e., it is not a de-duplicated count)
- int fNumPaintWithPathEffectUses;
- // This field is incremented every time an anti-aliased drawPath call is
- // issued with a concave path
- int fNumAAConcavePaths;
- // This field is incremented every time a drawPath call is
- // issued for a hairline stroked concave path.
- int fNumAAHairlineConcavePaths;
- };
-
- ContentInfo fContentInfo;
-
- void incPaintWithPathEffectUses() {
- ++fContentInfo.fNumPaintWithPathEffectUses;
- }
- int numPaintWithPathEffectUses() const {
- return fContentInfo.fNumPaintWithPathEffectUses;
- }
-
- void incAAConcavePaths() {
- ++fContentInfo.fNumAAConcavePaths;
- }
- int numAAConcavePaths() const {
- return fContentInfo.fNumAAConcavePaths;
- }
-
- void incAAHairlineConcavePaths() {
- ++fContentInfo.fNumAAHairlineConcavePaths;
- SkASSERT(fContentInfo.fNumAAHairlineConcavePaths <= fContentInfo.fNumAAConcavePaths);
- }
- int numAAHairlineConcavePaths() const {
- return fContentInfo.fNumAAHairlineConcavePaths;
- }
-
const SkPath& getPath(int index) const;
int addPathToHeap(const SkPath& path);
@@ -399,12 +337,10 @@ private:
void createHeader(SkPictInfo* info) const;
static bool IsValidPictInfo(const SkPictInfo& info);
- static SkPicturePlayback* FakeEndRecording(const SkPicture* resourceSrc,
- const SkPictureRecord& record);
friend class SkFlatPicture;
friend class SkPicturePlayback;
- friend class SkPictureRecorder;
+ friend class SkPictureRecorder; // just for SkPicture-based constructor
friend class SkGpuDevice;
friend class GrGatherCanvas;
friend class GrGatherDevice;
« no previous file with comments | « no previous file | include/core/SkPictureRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698