Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(446)

Issue 7230049: Implement support for origin-TopLeft render targets in GL backend. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by Stephen White
Modified:
11 years, 9 months ago
Reviewers:
bsalomon, reed1
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

Implement support for origin-TopLeft render targets. Note that the default behaviour remains the same: textures default to origin-TopLeft, render targets default to origin-BottomLeft, and backend textures default to origin-BottomLeft. However, the caller can override the default by setting fOrigin in GrTextureDesc, GrBackendTextureDesc or GrBackendRenderTargetDesc. Committed: https://code.google.com/p/skia/source/detail?r=7594

Patch Set 1 #

Patch Set 2 : Add support for surface origin to GrTextureDesc. #

Patch Set 3 : Add support for readPixels(), tests. #

Patch Set 4 : Fix whitespace; remove commented-out code. #

Patch Set 5 : Add origin support to the GrBackendRenderTargetDesc. #

Total comments: 5

Patch Set 6 : Checkpoint: readpixels now working for both origins. #

Patch Set 7 : Checkpoint: fix invertY in GrGpuGL::onReadPixels() (rename to flipY). fix fragcoord hack. removeā€¦ #

Patch Set 8 : Bring back kDefault_GrSurfaceOrigin (texture defaults TopLeft, RT defaults BottomLeft) #

Total comments: 1

Patch Set 9 : Move fLastOrigin to fHWPathMatrixState. #

Patch Set 10 : Update to ToT. #

Patch Set 11 : For onWrapBackendTexture() to use BottomLeft textures by default, even for non-RT's. #

Patch Set 12 : Force onWrapBackendTexture() to use BottomLeft textures by default, even for non-RT's. #

Total comments: 2

Patch Set 13 : Only set backend textures to BottomLeft if the desc has default origin. #

Patch Set 14 : static fn -> namespace {} #

Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -143 lines) Patch
M include/gpu/GrRenderTarget.h View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M include/gpu/GrSurface.h View 1 2 2 chunks +4 lines, -7 lines 0 comments Download
M include/gpu/GrTexture.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M include/gpu/GrTypes.h View 1 2 3 4 5 6 7 4 chunks +7 lines, -3 lines 0 comments Download
M samplecode/SampleApp.cpp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/gpu/GrContext.cpp View 1 2 3 4 5 6 7 6 chunks +9 lines, -55 lines 0 comments Download
M src/gpu/GrGpu.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -4 lines 0 comments Download
M src/gpu/GrGpu.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M src/gpu/GrTexture.cpp View 1 2 3 1 chunk +5 lines, -3 lines 0 comments Download
M src/gpu/gl/GrGLIRect.h View 1 2 3 4 5 1 chunk +8 lines, -3 lines 0 comments Download
M src/gpu/gl/GrGLProgram.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M src/gpu/gl/GrGLProgram.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/gpu/gl/GrGLRenderTarget.h View 1 2 1 chunk +7 lines, -6 lines 0 comments Download
M src/gpu/gl/GrGLRenderTarget.cpp View 1 2 3 chunks +7 lines, -6 lines 0 comments Download
M src/gpu/gl/GrGLShaderBuilder.cpp View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLTexture.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M src/gpu/gl/GrGLTexture.cpp View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
M src/gpu/gl/GrGpuGL.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -4 lines 0 comments Download
M src/gpu/gl/GrGpuGL.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 chunks +52 lines, -23 lines 0 comments Download
M src/gpu/gl/GrGpuGL_program.cpp View 1 2 3 4 5 6 7 8 3 chunks +24 lines, -8 lines 0 comments Download
M tests/ReadPixelsTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -2 lines 0 comments Download
M tests/WritePixelsTest.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +20 lines, -6 lines 0 comments Download

Messages

Total messages: 17
Stephen White
PTAL. This should probably get some testing love, but I'm not sure if that should ...
11 years, 10 months ago (2013-01-28 19:47:46 UTC) #1
bsalomon
On 2013/01/28 19:47:46, Stephen White wrote: > PTAL. This should probably get some testing love, ...
11 years, 10 months ago (2013-01-28 20:05:49 UTC) #2
Stephen White
On 2013/01/28 20:05:49, bsalomon wrote: > On 2013/01/28 19:47:46, Stephen White wrote: > > PTAL. ...
11 years, 10 months ago (2013-01-30 03:20:21 UTC) #3
bsalomon
This looks mostly right. Comments inline. https://codereview.appspot.com/7230049/diff/7003/include/gpu/GrTypes.h File include/gpu/GrTypes.h (right): https://codereview.appspot.com/7230049/diff/7003/include/gpu/GrTypes.h#newcode643 include/gpu/GrTypes.h:643: GrBackendRenderTargetDesc() { memset(this, ...
11 years, 10 months ago (2013-01-30 13:55:54 UTC) #4
Stephen White
This patch now passes all GM's and unit tests, albeit by restoring the old behaviour ...
11 years, 9 months ago (2013-02-04 16:05:26 UTC) #5
bsalomon
https://codereview.appspot.com/7230049/diff/21001/src/gpu/gl/GrGpuGL.h File src/gpu/gl/GrGpuGL.h (right): https://codereview.appspot.com/7230049/diff/21001/src/gpu/gl/GrGpuGL.h#newcode340 src/gpu/gl/GrGpuGL.h:340: GrSurfaceOrigin fLastOrigin; Let's move this to the fHWPathMatrixState struct.
11 years, 9 months ago (2013-02-04 16:12:31 UTC) #6
Stephen White
On 2013/02/04 16:12:31, bsalomon wrote: > https://codereview.appspot.com/7230049/diff/21001/src/gpu/gl/GrGpuGL.h > File src/gpu/gl/GrGpuGL.h (right): > > https://codereview.appspot.com/7230049/diff/21001/src/gpu/gl/GrGpuGL.h#newcode340 > ...
11 years, 9 months ago (2013-02-04 16:22:15 UTC) #7
bsalomon
lgtm
11 years, 9 months ago (2013-02-04 16:23:04 UTC) #8
Stephen White
Updated past your ANGLE change; please take a look to make sure I didn't mess ...
11 years, 9 months ago (2013-02-04 16:44:07 UTC) #9
bsalomon
On 2013/02/04 16:44:07, Stephen White wrote: > Updated past your ANGLE change; please take a ...
11 years, 9 months ago (2013-02-04 16:45:13 UTC) #10
Stephen White
PTAL. I messed up onWrapBackendTexture(), since I didn't notice that it forces all textures to ...
11 years, 9 months ago (2013-02-05 16:06:53 UTC) #11
bsalomon
LGTM modulo silly style comments. But let's hold off on re-landing until the DEPS roll ...
11 years, 9 months ago (2013-02-05 16:12:06 UTC) #12
reed1
lets run this locally in a chrome build, to try out DRT before committing.
11 years, 9 months ago (2013-02-05 16:14:37 UTC) #13
Stephen White
On 2013/02/05 16:14:37, reed1 wrote: > lets run this locally in a chrome build, to ...
11 years, 9 months ago (2013-02-05 16:16:24 UTC) #14
Stephen White
https://codereview.appspot.com/7230049/diff/46001/src/gpu/gl/GrGpuGL.cpp File src/gpu/gl/GrGpuGL.cpp (right): https://codereview.appspot.com/7230049/diff/46001/src/gpu/gl/GrGpuGL.cpp#newcode150 src/gpu/gl/GrGpuGL.cpp:150: static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget) { On 2013/02/05 ...
11 years, 9 months ago (2013-02-05 16:22:27 UTC) #15
bsalomon
On 2013/02/05 16:22:27, Stephen White wrote: > https://codereview.appspot.com/7230049/diff/46001/src/gpu/gl/GrGpuGL.cpp > File src/gpu/gl/GrGpuGL.cpp (right): > > https://codereview.appspot.com/7230049/diff/46001/src/gpu/gl/GrGpuGL.cpp#newcode150 ...
11 years, 9 months ago (2013-02-05 16:29:24 UTC) #16
Stephen White
11 years, 9 months ago (2013-02-05 18:09:18 UTC) #17
On 2013/02/05 16:29:24, bsalomon wrote:
> On 2013/02/05 16:22:27, Stephen White wrote:
> > https://codereview.appspot.com/7230049/diff/46001/src/gpu/gl/GrGpuGL.cpp
> > File src/gpu/gl/GrGpuGL.cpp (right):
> > 
> >
>
https://codereview.appspot.com/7230049/diff/46001/src/gpu/gl/GrGpuGL.cpp#newc...
> > src/gpu/gl/GrGpuGL.cpp:150: static GrSurfaceOrigin
> > resolve_origin(GrSurfaceOrigin origin, bool renderTarget) {
> > On 2013/02/05 16:12:06, bsalomon wrote:
> > > namespace { rather than static.
> > 
> > Done.
> > 
> > > The other helpers in this file are defined just above where they are
(first)
> > > used. I think most of Skia code is like this.
> > 
> > Actually I was trying to follow the function above it (fbo_test), which is
> > static, rather than namespace {}.  :)
> 
> Oh haha.. I guess that one was never updated. It's not even called anymore and
> should probably be removed. It was part of a workaround for a driver bug that
> hopefully was fixed long ago.
> 
> Can we add a comment to the decl of kDefault that it is deprecated and will be
> removed? (No need to reupload)

Will do.  Thanks for the review.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b