diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-04 17:29:51 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-04 17:29:51 +0000 |
commit | ed8659b51d9f2bad3f004df6033d72cc32d71c0d (patch) | |
tree | c9882164b3ce1c63e164bf0434c9505c95f80b6f /include/gpu | |
parent | 83f7c659461d602e498569dab63f04b1b578b742 (diff) |
Implement support for origin-TopLeft render targets in GL backend.
Review URL: https://codereview.appspot.com/7230049
git-svn-id: http://skia.googlecode.com/svn/trunk@7545 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrRenderTarget.h | 5 | ||||
-rw-r--r-- | include/gpu/GrSurface.h | 11 | ||||
-rw-r--r-- | include/gpu/GrTexture.h | 4 | ||||
-rw-r--r-- | include/gpu/GrTypes.h | 10 |
4 files changed, 15 insertions, 15 deletions
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h index 19a37a5d8b..fcb4c3d3b1 100644 --- a/include/gpu/GrRenderTarget.h +++ b/include/gpu/GrRenderTarget.h @@ -141,9 +141,8 @@ protected: GrRenderTarget(GrGpu* gpu, bool isWrapped, GrTexture* texture, - const GrTextureDesc& desc, - GrSurfaceOrigin origin) - : INHERITED(gpu, isWrapped, desc, origin) + const GrTextureDesc& desc) + : INHERITED(gpu, isWrapped, desc) , fStencilBuffer(NULL) , fTexture(texture) { fResolveRect.setLargestInverted(); diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h index 3429cc6d80..02fc0d5dea 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 == fOrigin || kBottomLeft_GrSurfaceOrigin == fOrigin); - return fOrigin; + GrAssert(kTopLeft_GrSurfaceOrigin == fDesc.fOrigin || kBottomLeft_GrSurfaceOrigin == fDesc.fOrigin); + return fDesc.fOrigin; } /** @@ -104,17 +104,14 @@ public: uint32_t pixelOpsFlags = 0) = 0; protected: - GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc, GrSurfaceOrigin origin) + GrSurface(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc) : INHERITED(gpu, isWrapped) - , fDesc(desc) - , fOrigin(origin) { + , fDesc(desc) { } GrTextureDesc fDesc; private: - GrSurfaceOrigin fOrigin; - typedef GrResource INHERITED; }; diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h index 94d578894b..c088bdd582 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, GrSurfaceOrigin origin) - : INHERITED(gpu, isWrapped, desc, origin) + GrTexture(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc) + : INHERITED(gpu, isWrapped, desc) , fRenderTarget(NULL) { // only make sense if alloc size is pow2 diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index 055750dd11..88c5771cbf 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -428,13 +428,14 @@ 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. 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. + * the origin. kDefault_GrSurfaceOrigin sets textures to TopLeft, and render targets + * to BottomLeft. */ enum GrSurfaceOrigin { - kBottomLeft_GrSurfaceOrigin, + kDefault_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin, + kBottomLeft_GrSurfaceOrigin, }; /** @@ -443,6 +444,7 @@ enum GrSurfaceOrigin { struct GrTextureDesc { GrTextureDesc() : fFlags(kNone_GrTextureFlags) + , fOrigin(kDefault_GrSurfaceOrigin) , fWidth(0) , fHeight(0) , fConfig(kUnknown_GrPixelConfig) @@ -450,6 +452,7 @@ 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 @@ -640,6 +643,7 @@ 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. |