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

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

Issue 1950523002: Remove GrLayerHoister (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Forgot to remove some files Created 4 years, 5 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 | « include/gpu/GrContext.h ('k') | src/core/SkBigPicture.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 2015 Google Inc. 2 * Copyright 2015 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 SkBigPicture_DEFINED 8 #ifndef SkBigPicture_DEFINED
9 #define SkBigPicture_DEFINED 9 #define SkBigPicture_DEFINED
10 10
11 #include "SkOnce.h" 11 #include "SkOnce.h"
12 #include "SkPicture.h" 12 #include "SkPicture.h"
13 #include "SkRect.h" 13 #include "SkRect.h"
14 #include "SkTemplates.h" 14 #include "SkTemplates.h"
15 15
16 class SkBBoxHierarchy; 16 class SkBBoxHierarchy;
17 class SkMatrix; 17 class SkMatrix;
18 class SkRecord; 18 class SkRecord;
19 19
20 // An implementation of SkPicture supporting an arbitrary number of drawing comm ands. 20 // An implementation of SkPicture supporting an arbitrary number of drawing comm ands.
21 class SkBigPicture final : public SkPicture { 21 class SkBigPicture final : public SkPicture {
22 public: 22 public:
23 // AccelData provides a base class for device-specific acceleration data.
24 class AccelData : public SkRefCnt { };
25
26 // An array of refcounted const SkPicture pointers. 23 // An array of refcounted const SkPicture pointers.
27 class SnapshotArray : ::SkNoncopyable { 24 class SnapshotArray : ::SkNoncopyable {
28 public: 25 public:
29 SnapshotArray(const SkPicture* pics[], int count) : fPics(pics), fCount( count) {} 26 SnapshotArray(const SkPicture* pics[], int count) : fPics(pics), fCount( count) {}
30 ~SnapshotArray() { for (int i = 0; i < fCount; i++) { fPics[i]->unref(); } } 27 ~SnapshotArray() { for (int i = 0; i < fCount; i++) { fPics[i]->unref(); } }
31 28
32 const SkPicture* const* begin() const { return fPics; } 29 const SkPicture* const* begin() const { return fPics; }
33 int count() const { return fCount; } 30 int count() const { return fCount; }
34 private: 31 private:
35 SkAutoTMalloc<const SkPicture*> fPics; 32 SkAutoTMalloc<const SkPicture*> fPics;
36 int fCount; 33 int fCount;
37 }; 34 };
38 35
39 SkBigPicture(const SkRect& cull, 36 SkBigPicture(const SkRect& cull,
40 SkRecord*, // We take ownership of the caller's ref. 37 SkRecord*, // We take ownership of the caller's ref.
41 SnapshotArray*, // We take exclusive ownership. 38 SnapshotArray*, // We take exclusive ownership.
42 SkBBoxHierarchy*, // We take ownership of the caller's ref. 39 SkBBoxHierarchy*, // We take ownership of the caller's ref.
43 AccelData*, // We take ownership of the caller's ref.
44 size_t approxBytesUsedBySubPictures); 40 size_t approxBytesUsedBySubPictures);
45 41
46 42
47 // SkPicture overrides 43 // SkPicture overrides
48 void playback(SkCanvas*, AbortCallback*) const override; 44 void playback(SkCanvas*, AbortCallback*) const override;
49 SkRect cullRect() const override; 45 SkRect cullRect() const override;
50 bool willPlayBackBitmaps() const override; 46 bool willPlayBackBitmaps() const override;
51 int approximateOpCount() const override; 47 int approximateOpCount() const override;
52 size_t approximateBytesUsed() const override; 48 size_t approximateBytesUsed() const override;
53 const SkBigPicture* asSkBigPicture() const override { return this; } 49 const SkBigPicture* asSkBigPicture() const override { return this; }
54 50
55 // Used by GrLayerHoister 51 // Used by GrLayerHoister
56 void partialPlayback(SkCanvas*, 52 void partialPlayback(SkCanvas*,
57 int start, 53 int start,
58 int stop, 54 int stop,
59 const SkMatrix& initialCTM) const; 55 const SkMatrix& initialCTM) const;
60 // Used by GrRecordReplaceDraw 56 // Used by GrRecordReplaceDraw
61 const SkBBoxHierarchy* bbh() const { return fBBH; } 57 const SkBBoxHierarchy* bbh() const { return fBBH; }
62 const SkRecord* record() const { return fRecord; } 58 const SkRecord* record() const { return fRecord; }
63 const AccelData* accelData() const { return fAccelData; }
64 59
65 private: 60 private:
66 struct Analysis { 61 struct Analysis {
67 void init(const SkRecord&); 62 void init(const SkRecord&);
68 63
69 bool suitableForGpuRasterization(const char** reason) const; 64 bool suitableForGpuRasterization(const char** reason) const;
70 65
71 uint8_t fNumSlowPathsAndDashEffects; 66 uint8_t fNumSlowPathsAndDashEffects;
72 bool fWillPlaybackBitmaps : 1; 67 bool fWillPlaybackBitmaps : 1;
73 }; 68 };
74 69
75 int numSlowPaths() const override; 70 int numSlowPaths() const override;
76 const Analysis& analysis() const; 71 const Analysis& analysis() const;
77 int drawableCount() const; 72 int drawableCount() const;
78 SkPicture const* const* drawablePicts() const; 73 SkPicture const* const* drawablePicts() const;
79 74
80 const SkRect fCullRect; 75 const SkRect fCullRect;
81 const size_t fApproxBytesUsedBySubPictures; 76 const size_t fApproxBytesUsedBySubPictures;
82 mutable SkOnce fAnalysisOnce; 77 mutable SkOnce fAnalysisOnce;
83 mutable Analysis fAnalysis; 78 mutable Analysis fAnalysis;
84 SkAutoTUnref<const SkRecord> fRecord; 79 SkAutoTUnref<const SkRecord> fRecord;
85 SkAutoTDelete<const SnapshotArray> fDrawablePicts; 80 SkAutoTDelete<const SnapshotArray> fDrawablePicts;
86 SkAutoTUnref<const SkBBoxHierarchy> fBBH; 81 SkAutoTUnref<const SkBBoxHierarchy> fBBH;
87 SkAutoTUnref<const AccelData> fAccelData;
88 }; 82 };
89 83
90 #endif//SkBigPicture_DEFINED 84 #endif//SkBigPicture_DEFINED
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkBigPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698