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 /src/gpu/gl/GrGLRenderTarget.cpp | |
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 'src/gpu/gl/GrGLRenderTarget.cpp')
-rw-r--r-- | src/gpu/gl/GrGLRenderTarget.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp index 47128e7064..69d7b9ca58 100644 --- a/src/gpu/gl/GrGLRenderTarget.cpp +++ b/src/gpu/gl/GrGLRenderTarget.cpp @@ -27,13 +27,15 @@ void GrGLRenderTarget::init(const Desc& desc, namespace { GrTextureDesc MakeDesc(GrTextureFlags flags, int width, int height, - GrPixelConfig config, int sampleCnt) { + GrPixelConfig config, int sampleCnt, + GrSurfaceOrigin origin) { GrTextureDesc temp; temp.fFlags = flags; temp.fWidth = width; temp.fHeight = height; temp.fConfig = config; temp.fSampleCnt = sampleCnt; + temp.fOrigin = origin; return temp; } @@ -49,9 +51,8 @@ GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu, texture, MakeDesc(kNone_GrTextureFlags, viewport.fWidth, viewport.fHeight, - desc.fConfig, desc.fSampleCnt), - texture->origin()) { - GrAssert(kBottomLeft_GrSurfaceOrigin == texture->origin()); + desc.fConfig, desc.fSampleCnt, + desc.fOrigin)) { GrAssert(NULL != texID); GrAssert(NULL != texture); // FBO 0 can't also be a texture, right? @@ -73,8 +74,8 @@ GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu, NULL, MakeDesc(kNone_GrTextureFlags, viewport.fWidth, viewport.fHeight, - desc.fConfig, desc.fSampleCnt), - kBottomLeft_GrSurfaceOrigin) { + desc.fConfig, desc.fSampleCnt, + desc.fOrigin)) { this->init(desc, viewport, NULL); } |