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

Unified Diff: include/core/SkCanvas.h

Issue 1763143002: WIP RasterCanvasLayerAllocator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: test and some further work Created 4 years, 7 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
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index ec14829ca85296d12d79d27a04073c6ee587c20e..e2cfa5ebf632372f21f82675c42cf92bd9ea4f41 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -33,6 +33,7 @@ class SkPath;
class SkPicture;
class SkPixmap;
class SkRasterClip;
+class SkRasterCanvasLayerAllocator;
class SkRRect;
struct SkRSXform;
class SkSurface;
@@ -1219,6 +1220,12 @@ public:
*/
void replayClips(ClipVisitor*) const;
+ /**
+ * Returns any OS-specific native context backing this SkCanvas,
+ * or nullptr.
+ */
+ void* getTopLayerNative() const;
+
///////////////////////////////////////////////////////////////////////////
// don't call
@@ -1413,7 +1420,7 @@ private:
enum {
kMCRecSize = 128, // most recent measurement
kMCRecCount = 32, // common depth for save/restores
- kDeviceCMSize = 176, // most recent measurement
+ kDeviceCMSize = 192, // most recent measurement
};
intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)];
intptr_t fDeviceCMStorage[kDeviceCMSize / sizeof(intptr_t)];
@@ -1450,6 +1457,7 @@ private:
friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProps*, InitFlags)
friend class SkPictureRecord; // predrawNotify (why does it need it? <reed>)
friend class SkPicturePlayback; // SaveFlagsToSaveLayerFlags
+ friend class SkRasterCanvasLayerAllocator;
enum InitFlags {
kDefault_InitFlags = 0,
@@ -1457,6 +1465,7 @@ private:
};
SkCanvas(const SkIRect& bounds, InitFlags);
SkCanvas(SkBaseDevice* device, InitFlags);
+ SkCanvas(const SkBitmap& bitmap, sk_sp<SkRasterCanvasLayerAllocator>);
tomhudson 2016/05/26 16:36:17 Figuring out lifetime here is a little awkward - t
reed1 2016/07/12 19:52:39 I think unique_ptr as a parameter type is fine. No
void resetForNextPicture(const SkIRect& bounds);
@@ -1468,7 +1477,7 @@ private:
// - internalSaveLayer
void setupDevice(SkBaseDevice*);
- SkBaseDevice* init(SkBaseDevice*, InitFlags);
+ SkBaseDevice* init(SkBaseDevice*, InitFlags, sk_sp<SkRasterCanvasLayerAllocator>);
/**
* Gets the bounds of the top level layer in global canvas coordinates. We don't want this
@@ -1543,6 +1552,8 @@ private:
void validateClip() const {}
#endif
+ sk_sp<SkRasterCanvasLayerAllocator> fAllocator;
+
typedef SkRefCnt INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698