aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkSurface.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-25 08:33:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-25 08:33:02 -0800
commit5ec26ae9bfca635ccc98283aad5deda11519d826 (patch)
treea95104e6a32178a9e3fd7305ed8ed59a6d0a0102 /include/core/SkSurface.h
parentf7e865a33a14007450259012a3ab7ec4ddc6f5b9 (diff)
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 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review URL: https://codereview.chromium.org/1728093005
Diffstat (limited to 'include/core/SkSurface.h')
-rw-r--r--include/core/SkSurface.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 975c80e3f0..0ab97285f4 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -30,18 +30,10 @@ 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
- };
-
+ static const SkBudgeted kYes_Budgeted = SkBudgeted::kYes;
+ static const SkBudgeted kNo_Budgeted = SkBudgeted::kNo;
+ using Budgeted = SkBudgeted;
+
/**
* Create a new surface, using the specified pixels/rowbytes as its
* backend.
@@ -135,10 +127,10 @@ public:
* additional textures.
*/
static SkSurface* NewRenderTarget(
- GrContext*, Budgeted, const SkImageInfo&, int sampleCount, const SkSurfaceProps* = NULL,
- GrTextureStorageAllocator = GrTextureStorageAllocator());
+ GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount,
+ const SkSurfaceProps* = NULL, GrTextureStorageAllocator = GrTextureStorageAllocator());
- static SkSurface* NewRenderTarget(GrContext* gr, Budgeted b, const SkImageInfo& info) {
+ static SkSurface* NewRenderTarget(GrContext* gr, SkBudgeted b, const SkImageInfo& info) {
return NewRenderTarget(gr, b, info, 0);
}
@@ -244,7 +236,7 @@ public:
* parameter controls whether it counts against the resource budget
* (currently for the gpu backend only).
*/
- SkImage* newImageSnapshot(Budgeted = kYes_Budgeted);
+ SkImage* newImageSnapshot(SkBudgeted = SkBudgeted::kYes);
/**
* In rare instances a client may want a unique copy of the SkSurface's contents in an image
@@ -256,7 +248,7 @@ public:
kNo_ForceUnique,
kYes_ForceUnique
};
- SkImage* newImageSnapshot(Budgeted, ForceUnique);
+ SkImage* newImageSnapshot(SkBudgeted, ForceUnique);
/**
* Though the caller could get a snapshot image explicitly, and draw that,