aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkSurface.h
diff options
context:
space:
mode:
authorGravatar erikchen <erikchen@chromium.org>2016-02-05 12:10:55 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-05 12:10:55 -0800
commit7fec91ce6660190f8d7c5eb6f3061e4550cc672b (patch)
tree2b2509fa48e9c7b57220fe0a58b8b97090359263 /include/core/SkSurface.h
parent3601f280dc400cb75167393b0a2b6670b5f25ea4 (diff)
skia: Add support for CHROMIUM_image backed textures.
I created a new abstract base class TextureStorageAllocator that consumers of Skia can subclass and pass back to Skia. When a surface is created with a pointer to a TextureStorageAllocator, any textures it creates, or that are derived from the original surface, will allocate and deallocate storage using the methods on TextureStorageAllocator. BUG=https://code.google.com/p/chromium/issues/detail?id=579664 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1623653002 Committed: https://skia.googlesource.com/skia/+/92098e691f10a010e7421125ba4d44c02506bb55 Review URL: https://codereview.chromium.org/1623653002
Diffstat (limited to 'include/core/SkSurface.h')
-rw-r--r--include/core/SkSurface.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 52097be66e..45262d78e6 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -120,12 +120,16 @@ public:
/**
* Return a new surface whose contents will be drawn to an offscreen
* render target, allocated by the surface.
+ *
+ * The GrTextureStorageAllocator will be reused if SkImage snapshots create
+ * additional textures.
*/
- static SkSurface* NewRenderTarget(GrContext*, Budgeted, const SkImageInfo&, int sampleCount,
- const SkSurfaceProps* = NULL);
+ static SkSurface* NewRenderTarget(
+ GrContext*, Budgeted, const SkImageInfo&, int sampleCount, const SkSurfaceProps* = NULL,
+ GrTextureStorageAllocator = GrTextureStorageAllocator());
static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageInfo& info) {
- return NewRenderTarget(gr, b, info, 0, NULL);
+ return NewRenderTarget(gr, b, info, 0);
}
int width() const { return fWidth; }