aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrRenderTarget.h2
-rw-r--r--include/gpu/GrSurface.h19
-rw-r--r--include/gpu/GrTexture.h2
-rw-r--r--include/gpu/GrTypes.h12
4 files changed, 18 insertions, 17 deletions
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index 4e77466b9a..19a37a5d8b 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -142,7 +142,7 @@ protected:
bool isWrapped,
GrTexture* texture,
const GrTextureDesc& desc,
- Origin origin)
+ GrSurfaceOrigin origin)
: INHERITED(gpu, isWrapped, desc, origin)
, fStencilBuffer(NULL)
, fTexture(texture) {
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 4ef0acb82e..8ccbc9833b 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -33,19 +33,8 @@ public:
*/
int height() const { return fDesc.fHeight; }
- /**
- * Some surfaces will be stored such that the upper and left edges of the content meet at the
- * the origin (in texture coord space) and for other surfaces the lower and left edges meet at
- * the origin. Render-targets are always consistent with the convention of the underlying
- * backend API to make it easier to mix native backend rendering with Skia rendering. Wrapped
- * backend surfaces always use the backend's convention as well.
- */
- enum Origin {
- kTopLeft_Origin,
- kBottomLeft_Origin,
- };
- Origin origin() const {
- GrAssert(kTopLeft_Origin == fOrigin || kBottomLeft_Origin == fOrigin);
+ GrSurfaceOrigin origin() const {
+ GrAssert(kTopLeft_SurfaceOrigin == fOrigin || kBottomLeft_SurfaceOrigin == fOrigin);
return fOrigin;
}
@@ -115,7 +104,7 @@ public:
uint32_t pixelOpsFlags = 0) = 0;
protected:
- GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc, Origin origin)
+ GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc, GrSurfaceOrigin origin)
: INHERITED(gpu, isWrapped)
, fDesc(desc)
, fOrigin(origin) {
@@ -124,7 +113,7 @@ protected:
GrTextureDesc fDesc;
private:
- Origin fOrigin;
+ GrSurfaceOrigin fOrigin;
typedef GrResource INHERITED;
};
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 657e6e5078..94d578894b 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -140,7 +140,7 @@ protected:
// base class cons sets to NULL
// subclass cons can create and set
- GrTexture(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc, Origin origin)
+ GrTexture(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc, GrSurfaceOrigin origin)
: INHERITED(gpu, isWrapped, desc, origin)
, fRenderTarget(NULL) {
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index d7241b499c..055750dd11 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -425,6 +425,17 @@ enum {
kGrColorTableSize = 256 * 4 //sizeof(GrColor)
};
+/**
+ * Some textures will be stored such that the upper and left edges of the content meet at the
+ * the origin (in texture coord space) and for other textures the lower and left edges meet at
+ * the origin. Render-targets are always consistent with the convention of the underlying
+ * backend API to make it easier to mix native backend rendering with Skia rendering.
+ */
+
+enum GrSurfaceOrigin {
+ kBottomLeft_GrSurfaceOrigin,
+ kTopLeft_GrSurfaceOrigin,
+};
/**
* Describes a texture to be created.
@@ -596,6 +607,7 @@ GR_MAKE_BITFIELD_OPS(GrBackendTextureFlags)
struct GrBackendTextureDesc {
GrBackendTextureDesc() { memset(this, 0, sizeof(*this)); }
GrBackendTextureFlags fFlags;
+ GrSurfaceOrigin fOrigin;
int fWidth; //<! width in pixels
int fHeight; //<! height in pixels
GrPixelConfig fConfig; //<! color format