diff options
author | 2016-02-04 12:03:07 -0800 | |
---|---|---|
committer | 2016-02-04 12:03:08 -0800 | |
commit | 92098e691f10a010e7421125ba4d44c02506bb55 (patch) | |
tree | d21c2a5640f1b88dfa0094e57bcd0d9da2f3e2f9 /src/image/SkSurface_Gpu.cpp | |
parent | f7cdb06d62bd732599c7ee407dfd76d32d671755 (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
Review URL: https://codereview.chromium.org/1623653002
Diffstat (limited to 'src/image/SkSurface_Gpu.cpp')
-rw-r--r-- | src/image/SkSurface_Gpu.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index 2d5645b2b0..f7a31c009b 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -121,9 +121,11 @@ SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf } SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const SkImageInfo& info, - int sampleCount, const SkSurfaceProps* props) { - SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctx, budgeted, info, sampleCount, props, - SkGpuDevice::kClear_InitContents)); + int sampleCount, const SkSurfaceProps* props, + GrTextureStorageAllocator customAllocator) { + SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create( + ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitContents, + customAllocator)); if (!device) { return nullptr; } |