diff options
author | 2016-02-25 06:52:12 -0800 | |
---|---|---|
committer | 2016-02-25 06:52:12 -0800 | |
commit | bd500f09ce5b1ca464431d693f9ec5da60a59230 (patch) | |
tree | 16d46d581f91f0ebbb9fbf2316be2be7fac32ad8 /include/core/SkSurface.h | |
parent | 2d07b76405a672dced858aaa9ed475755ea13305 (diff) |
Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (patchset #6 id:100001 of https://codereview.chromium.org/1728093005/ )
Reason for revert:
Need workaround for chrome to build
Original issue's description:
> Move Budgeted enum out of SkSurface, use in GrTextureProvider
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005
> DOCS_PREVIEW= https://skia.org/?cl=1728093005
>
> Committed: https://skia.googlesource.com/skia/+/57599fe6c0336feaeeeb9b1996e77b70219b483c
TBR=reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1734043002
Diffstat (limited to 'include/core/SkSurface.h')
-rw-r--r-- | include/core/SkSurface.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h index 7a0352994a..975c80e3f0 100644 --- a/include/core/SkSurface.h +++ b/include/core/SkSurface.h @@ -31,6 +31,18 @@ class GrRenderTarget; 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 @@ public: * additional textures. */ static SkSurface* NewRenderTarget( - GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount, - const SkSurfaceProps* = NULL, GrTextureStorageAllocator = GrTextureStorageAllocator()); + GrContext*, Budgeted, const SkImageInfo&, int sampleCount, const SkSurfaceProps* = NULL, + GrTextureStorageAllocator = GrTextureStorageAllocator()); - static SkSurface* NewRenderTarget(GrContext* gr, SkBudgeted b, const SkImageInfo& info) { + static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageInfo& info) { return NewRenderTarget(gr, b, info, 0); } @@ -232,7 +244,7 @@ public: * 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 @@ public: kNo_ForceUnique, kYes_ForceUnique }; - SkImage* newImageSnapshot(SkBudgeted, ForceUnique); + SkImage* newImageSnapshot(Budgeted, ForceUnique); /** * Though the caller could get a snapshot image explicitly, and draw that, |