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

Side by Side Diff: src/gpu/GrPictureUtils.h

Issue 212933002: Actually identify required saveLayers in SkGpuDevice::EXPERIMENTAL_drawPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issue Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrClipData.cpp ('k') | src/gpu/GrPictureUtils.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrPictureUtils_DEFINED
9 #define GrPictureUtils_DEFINED
10
11 #include "SkPicture.h"
12 #include "SkTDArray.h"
13
14 // This class encapsulates the GPU-backend-specific acceleration data
15 // for a single SkPicture
16 class GPUAccelData : public SkPicture::AccelData {
17 public:
18 // Information about a given saveLayer in an SkPicture
19 struct SaveLayerInfo {
20 // The size of the saveLayer
21 SkISize fSize;
22 // The ID of this saveLayer in the picture. 0 is an invalid ID.
23 size_t fSaveLayerOpID;
24 // The ID of the matching restore in the picture. 0 is an invalid ID.
25 size_t fRestoreOpID;
26 // True if this saveLayer has at least one other saveLayer nested within it.
27 // False otherwise.
28 bool fHasNestedLayers;
29 };
30
31 GPUAccelData(Key key) : INHERITED(key) { }
32
33 void addSaveLayerInfo(const SaveLayerInfo& info) {
34 SkASSERT(info.fSaveLayerOpID < info.fRestoreOpID);
35 *fSaveLayerInfo.push() = info;
36 }
37
38 int numSaveLayers() const { return fSaveLayerInfo.count(); }
39
40 const SaveLayerInfo& saveLayerInfo(int index) const {
41 SkASSERT(index < fSaveLayerInfo.count());
42
43 return fSaveLayerInfo[index];
44 }
45
46 protected:
47 SkTDArray<SaveLayerInfo> fSaveLayerInfo;
48
49 private:
50 typedef SkPicture::AccelData INHERITED;
51 };
52
53 void GatherGPUInfo(SkPicture* pict, GPUAccelData* accelData);
54
55 #endif // GrPictureUtils_DEFINED
OLDNEW
« no previous file with comments | « src/gpu/GrClipData.cpp ('k') | src/gpu/GrPictureUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698