diff options
author | 2016-02-10 16:32:34 -0800 | |
---|---|---|
committer | 2016-02-10 16:32:35 -0800 | |
commit | 9a1ed5d81dbfc7d5b67b568dfe12b4033a9af154 (patch) | |
tree | b3aace8f70ea76da04db55fd0be90b22d7b27b85 /src/gpu/SkGpuDevice.h | |
parent | 4a6e40d9d2e0eb81e00d8b2bd20532aa28f61afb (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
Committed: https://skia.googlesource.com/skia/+/7fec91ce6660190f8d7c5eb6f3061e4550cc672b
Committed: https://skia.googlesource.com/skia/+/b8d6e088590160f1198110c2371b802c1d541a36
Review URL: https://codereview.chromium.org/1623653002
Diffstat (limited to 'src/gpu/SkGpuDevice.h')
-rw-r--r-- | src/gpu/SkGpuDevice.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index 8bf04b1182..ec3e158706 100644 --- a/src/gpu/SkGpuDevice.h +++ b/src/gpu/SkGpuDevice.h @@ -18,6 +18,7 @@ #include "GrDrawContext.h" #include "GrContext.h" #include "GrSurfacePriv.h" +#include "GrTypes.h" class GrAccelData; class GrTextureProducer; @@ -52,7 +53,8 @@ public: * the resource cache budget. On failure, returns nullptr. */ static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInfo&, - int sampleCount, const SkSurfaceProps*, InitContents); + int sampleCount, const SkSurfaceProps*, + InitContents, GrTextureStorageAllocator = GrTextureStorageAllocator()); ~SkGpuDevice() override {} @@ -255,7 +257,7 @@ private: bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, const SkImageInfo&, - int sampleCount); + int sampleCount, GrTextureStorageAllocator); friend class GrAtlasTextContext; friend class SkSurface_Gpu; // for access to surfaceProps |