aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrTypes.h
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-28 16:42:38 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-28 16:42:38 +0000
commitef5dbe1cd90fe586f165e54cb6f7608942610793 (patch)
treed3634e1c6676c96145f8047c17d94fb8b6e5f11f /include/gpu/GrTypes.h
parent02ddc8b85ace91b15feb329a6a1d5d62b2b846c6 (diff)
Add an origin flag for backend (external) textures. Some textures in WebKit have a topdown orientation, and skia needs to be notified of this, so that they are not drawn upside-down.
Review URL: https://codereview.appspot.com/7200048 git-svn-id: http://skia.googlecode.com/svn/trunk@7414 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrTypes.h')
-rw-r--r--include/gpu/GrTypes.h12
1 files changed, 12 insertions, 0 deletions
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