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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClipData.cpp ('k') | src/gpu/GrPictureUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPictureUtils.h
===================================================================
--- src/gpu/GrPictureUtils.h (revision 0)
+++ src/gpu/GrPictureUtils.h (revision 0)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrPictureUtils_DEFINED
+#define GrPictureUtils_DEFINED
+
+#include "SkPicture.h"
+#include "SkTDArray.h"
+
+// This class encapsulates the GPU-backend-specific acceleration data
+// for a single SkPicture
+class GPUAccelData : public SkPicture::AccelData {
+public:
+ // Information about a given saveLayer in an SkPicture
+ struct SaveLayerInfo {
+ // The size of the saveLayer
+ SkISize fSize;
+ // The ID of this saveLayer in the picture. 0 is an invalid ID.
+ size_t fSaveLayerOpID;
+ // The ID of the matching restore in the picture. 0 is an invalid ID.
+ size_t fRestoreOpID;
+ // True if this saveLayer has at least one other saveLayer nested within it.
+ // False otherwise.
+ bool fHasNestedLayers;
+ };
+
+ GPUAccelData(Key key) : INHERITED(key) { }
+
+ void addSaveLayerInfo(const SaveLayerInfo& info) {
+ SkASSERT(info.fSaveLayerOpID < info.fRestoreOpID);
+ *fSaveLayerInfo.push() = info;
+ }
+
+ int numSaveLayers() const { return fSaveLayerInfo.count(); }
+
+ const SaveLayerInfo& saveLayerInfo(int index) const {
+ SkASSERT(index < fSaveLayerInfo.count());
+
+ return fSaveLayerInfo[index];
+ }
+
+protected:
+ SkTDArray<SaveLayerInfo> fSaveLayerInfo;
+
+private:
+ typedef SkPicture::AccelData INHERITED;
+};
+
+void GatherGPUInfo(SkPicture* pict, GPUAccelData* accelData);
+
+#endif // GrPictureUtils_DEFINED
Property changes on: src\gpu\GrPictureUtils.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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