Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: include/core/SkSurface.h

Issue 1728093005: Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add aliases for Chrome Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/xfermodes3.cpp ('k') | include/core/SkTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkSurface.h
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 975c80e3f087da0c49fa6227ae7bdec2c4b39bc4..0ab97285f4c4628031fd996adcfb433e3214f3fb 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,
« no previous file with comments | « gm/xfermodes3.cpp ('k') | include/core/SkTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698