aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/core/SkSurface.h22
-rw-r--r--include/core/SkTypes.h11
-rw-r--r--include/gpu/GrTextureProvider.h6
3 files changed, 20 insertions, 19 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,
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 756eae8628..4592168bd4 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -439,17 +439,6 @@ template <typename T> static inline const T& SkTPin(const T& value, const T& min
return SkTMax(SkTMin(value, max), min);
}
-
-///////////////////////////////////////////////////////////////////////////////
-
-/**
- * Indicates whether an allocation should count against a cache budget.
- */
-enum class SkBudgeted : bool {
- kNo = false,
- kYes = true
-};
-
///////////////////////////////////////////////////////////////////////////////
/** Use to combine multiple bits in a bitmask in a type safe way.
diff --git a/include/gpu/GrTextureProvider.h b/include/gpu/GrTextureProvider.h
index e75589ec97..3fa359d19a 100644
--- a/include/gpu/GrTextureProvider.h
+++ b/include/gpu/GrTextureProvider.h
@@ -29,11 +29,11 @@ public:
* implies tightly packed rows. For compressed pixel configs, this
* field is ignored.
*/
- GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, const void* srcData,
+ GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, const void* srcData,
size_t rowBytes);
/** Shortcut for creating a texture with no initial data to upload. */
- GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) {
+ GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted) {
return this->createTexture(desc, budgeted, NULL, 0);
}
@@ -73,7 +73,7 @@ public:
if (kApprox_ScratchTexMatch == match) {
return this->createApproxTexture(desc);
} else {
- return this->createTexture(desc, SkBudgeted::kYes);
+ return this->createTexture(desc, true);
}
}