| Index: include/core/SkSurface.h
|
| diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
|
| index 7a0352994ae143a96c5b4f6312307e5c5d0d7b6a..975c80e3f087da0c49fa6227ae7bdec2c4b39bc4 100644
|
| --- a/include/core/SkSurface.h
|
| +++ b/include/core/SkSurface.h
|
| @@ -31,6 +31,18 @@
|
| class SK_API SkSurface : public SkRefCnt {
|
| public:
|
| /**
|
| + * Indicates whether a new surface or image should count against a cache budget. Currently this
|
| + * is only used by the GPU backend (sw-raster surfaces and images are never counted against the
|
| + * resource cache budget.)
|
| + */
|
| + enum Budgeted {
|
| + /** The surface or image does not count against the cache budget. */
|
| + kNo_Budgeted,
|
| + /** The surface or image counts against the cache budget. */
|
| + kYes_Budgeted
|
| + };
|
| +
|
| + /**
|
| * Create a new surface, using the specified pixels/rowbytes as its
|
| * backend.
|
| *
|
| @@ -123,10 +135,10 @@
|
| * additional textures.
|
| */
|
| static SkSurface* NewRenderTarget(
|
| - GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount,
|
| - const SkSurfaceProps* = NULL, GrTextureStorageAllocator = GrTextureStorageAllocator());
|
| -
|
| - static SkSurface* NewRenderTarget(GrContext* gr, SkBudgeted b, const SkImageInfo& info) {
|
| + 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);
|
| }
|
|
|
| @@ -232,7 +244,7 @@
|
| * parameter controls whether it counts against the resource budget
|
| * (currently for the gpu backend only).
|
| */
|
| - SkImage* newImageSnapshot(SkBudgeted = SkBudgeted::kYes);
|
| + SkImage* newImageSnapshot(Budgeted = kYes_Budgeted);
|
|
|
| /**
|
| * In rare instances a client may want a unique copy of the SkSurface's contents in an image
|
| @@ -244,7 +256,7 @@
|
| kNo_ForceUnique,
|
| kYes_ForceUnique
|
| };
|
| - SkImage* newImageSnapshot(SkBudgeted, ForceUnique);
|
| + SkImage* newImageSnapshot(Budgeted, ForceUnique);
|
|
|
| /**
|
| * Though the caller could get a snapshot image explicitly, and draw that,
|
|
|