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

Unified Diff: include/gpu/GrTypes.h

Issue 682223002: rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: const Created 6 years, 2 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 | « include/gpu/GrTexture.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index e9c5db00ea3984aaddeffd8d087712691ff2a156..850d200886893bff530b1e7c05dec77a41aa2aa2 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -419,34 +419,37 @@ static inline bool GrPixelConfigIsAlphaOnly(GrPixelConfig config) {
}
/**
- * Optional bitfield flags that can be passed to createTexture.
+ * Optional bitfield flags that can be set on GrSurfaceDesc (below).
*/
-enum GrTextureFlags {
- kNone_GrTextureFlags = 0x0,
+enum GrSurfaceFlags {
+ kNone_GrSurfaceFlags = 0x0,
/**
* Creates a texture that can be rendered to as a GrRenderTarget. Use
* GrTexture::asRenderTarget() to access.
*/
- kRenderTarget_GrTextureFlagBit = 0x1,
+ kRenderTarget_GrSurfaceFlag = 0x1,
/**
* By default all render targets have an associated stencil buffer that
* may be required for path filling. This flag overrides stencil buffer
* creation.
* MAKE THIS PRIVATE?
*/
- kNoStencil_GrTextureFlagBit = 0x2,
- /**
- * Hint that the CPU may modify this texture after creation.
- */
- kDynamicUpdate_GrTextureFlagBit = 0x4,
+ kNoStencil_GrSurfaceFlag = 0x2,
/**
* Indicates that all allocations (color buffer, FBO completeness, etc)
* should be verified.
*/
- kCheckAllocation_GrTextureFlagBit = 0x8,
+ kCheckAllocation_GrSurfaceFlag = 0x4,
};
-GR_MAKE_BITFIELD_OPS(GrTextureFlags)
+GR_MAKE_BITFIELD_OPS(GrSurfaceFlags)
+
+// Legacy aliases
+typedef GrSurfaceFlags GrTextureFlags;
+static const GrSurfaceFlags kNone_GrTextureFlags = kNone_GrSurfaceFlags;
+static const GrSurfaceFlags kRenderTarget_GrTExtureFlagBit = kRenderTarget_GrSurfaceFlag;
+static const GrSurfaceFlags kNoStencil_GrTextureFlagBit = kNoStencil_GrSurfaceFlag;
+static const GrSurfaceFlags kCheckAllocation_GrTextureFlagBit = kCheckAllocation_GrSurfaceFlag;
/**
* Some textures will be stored such that the upper and left edges of the content meet at the
@@ -462,11 +465,11 @@ enum GrSurfaceOrigin {
};
/**
- * Describes a texture to be created.
+ * Describes a surface to be created.
*/
-struct GrTextureDesc {
- GrTextureDesc()
- : fFlags(kNone_GrTextureFlags)
+struct GrSurfaceDesc {
+ GrSurfaceDesc()
+ : fFlags(kNone_GrSurfaceFlags)
, fOrigin(kDefault_GrSurfaceOrigin)
, fWidth(0)
, fHeight(0)
@@ -474,7 +477,7 @@ struct GrTextureDesc {
, fSampleCnt(0) {
}
- GrTextureFlags fFlags; //!< bitfield of TextureFlags
+ GrSurfaceFlags fFlags; //!< bitfield of TextureFlags
GrSurfaceOrigin fOrigin; //!< origin of the texture
int fWidth; //!< Width of the texture
int fHeight; //!< Height of the texture
@@ -487,7 +490,7 @@ struct GrTextureDesc {
/**
* The number of samples per pixel or 0 to disable full scene AA. This only
- * applies if the kRenderTarget_GrTextureFlagBit is set. The actual number
+ * applies if the kRenderTarget_GrSurfaceFlag is set. The actual number
* of samples may not exactly match the request. The request will be rounded
* up to the next supported sample count, or down if it is larger than the
* max supported count.
@@ -495,6 +498,9 @@ struct GrTextureDesc {
int fSampleCnt;
};
+// Legacy alias
+typedef GrSurfaceDesc GrTextureDesc;
+
/**
* GrCacheID is used create and find cached GrResources (e.g. GrTextures). The ID has two parts:
* the domain and the key. Domains simply allow multiple clients to use 0-based indices as their
@@ -585,15 +591,12 @@ enum GrBackendTextureFlags {
/**
* No flags enabled
*/
- kNone_GrBackendTextureFlag = kNone_GrTextureFlags,
+ kNone_GrBackendTextureFlag = 0,
/**
* Indicates that the texture is also a render target, and thus should have
* a GrRenderTarget object.
- *
- * D3D (future): client must have created the texture with flags that allow
- * it to be used as a render target.
*/
- kRenderTarget_GrBackendTextureFlag = kRenderTarget_GrTextureFlagBit,
+ kRenderTarget_GrBackendTextureFlag = kRenderTarget_GrSurfaceFlag,
};
GR_MAKE_BITFIELD_OPS(GrBackendTextureFlags)
« no previous file with comments | « include/gpu/GrTexture.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698