aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-05 14:05:06 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-05 14:05:06 +0000
commitcf9faf6ce9e3351b4d4030753eb43c8cd2010e0c (patch)
treeb54f84cbd628e82f70bd74895ebbbe4f115509ac /include
parent0c38ed3b1d704a0ed6147299046f51fd52e841a2 (diff)
Reverting r7545 (render target origin change) due to layout test issues (see https://codereview.chromium.org/12210002/)
git-svn-id: http://skia.googlecode.com/svn/trunk@7571 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrRenderTarget.h5
-rw-r--r--include/gpu/GrSurface.h11
-rw-r--r--include/gpu/GrTexture.h4
-rw-r--r--include/gpu/GrTypes.h10
4 files changed, 15 insertions, 15 deletions
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index fcb4c3d3b1..19a37a5d8b 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -141,8 +141,9 @@ protected:
GrRenderTarget(GrGpu* gpu,
bool isWrapped,
GrTexture* texture,
- const GrTextureDesc& desc)
- : INHERITED(gpu, isWrapped, desc)
+ const GrTextureDesc& desc,
+ GrSurfaceOrigin origin)
+ : INHERITED(gpu, isWrapped, desc, origin)
, fStencilBuffer(NULL)
, fTexture(texture) {
fResolveRect.setLargestInverted();
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 02fc0d5dea..3429cc6d80 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -34,8 +34,8 @@ public:
int height() const { return fDesc.fHeight; }
GrSurfaceOrigin origin() const {
- GrAssert(kTopLeft_GrSurfaceOrigin == fDesc.fOrigin || kBottomLeft_GrSurfaceOrigin == fDesc.fOrigin);
- return fDesc.fOrigin;
+ GrAssert(kTopLeft_GrSurfaceOrigin == fOrigin || kBottomLeft_GrSurfaceOrigin == fOrigin);
+ return fOrigin;
}
/**
@@ -104,14 +104,17 @@ public:
uint32_t pixelOpsFlags = 0) = 0;
protected:
- GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc)
+ GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc, GrSurfaceOrigin origin)
: INHERITED(gpu, isWrapped)
- , fDesc(desc) {
+ , fDesc(desc)
+ , fOrigin(origin) {
}
GrTextureDesc fDesc;
private:
+ GrSurfaceOrigin fOrigin;
+
typedef GrResource INHERITED;
};
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index c088bdd582..94d578894b 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -140,8 +140,8 @@ protected:
// base class cons sets to NULL
// subclass cons can create and set
- GrTexture(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc)
- : INHERITED(gpu, isWrapped, desc)
+ GrTexture(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc, GrSurfaceOrigin origin)
+ : INHERITED(gpu, isWrapped, desc, origin)
, fRenderTarget(NULL) {
// only make sense if alloc size is pow2
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 88c5771cbf..055750dd11 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -428,14 +428,13 @@ enum {
/**
* 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. kDefault_GrSurfaceOrigin sets textures to TopLeft, and render targets
- * to BottomLeft.
+ * 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 {
- kDefault_GrSurfaceOrigin,
- kTopLeft_GrSurfaceOrigin,
kBottomLeft_GrSurfaceOrigin,
+ kTopLeft_GrSurfaceOrigin,
};
/**
@@ -444,7 +443,6 @@ enum GrSurfaceOrigin {
struct GrTextureDesc {
GrTextureDesc()
: fFlags(kNone_GrTextureFlags)
- , fOrigin(kDefault_GrSurfaceOrigin)
, fWidth(0)
, fHeight(0)
, fConfig(kUnknown_GrPixelConfig)
@@ -452,7 +450,6 @@ struct GrTextureDesc {
}
GrTextureFlags fFlags; //!< bitfield of TextureFlags
- GrSurfaceOrigin fOrigin; //!< origin of the texture
int fWidth; //!< Width of the texture
int fHeight; //!< Height of the texture
@@ -643,7 +640,6 @@ struct GrBackendRenderTargetDesc {
int fWidth; //<! width in pixels
int fHeight; //<! height in pixels
GrPixelConfig fConfig; //<! color format
- GrSurfaceOrigin fOrigin; //<! pixel origin
/**
* The number of samples per pixel. Gr uses this to influence decisions
* about applying other forms of anti-aliasing.