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

Issue 7180048: Change filterImageGPU() to use SkBitmap (Closed)

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

Description

This changes the signature of SkImageFilter::filterImageGPU() to use SkBitmaps for input and output, and removes the rect param. This allows us to return textures which are larger than the actual result, such as when GrAutoScratchTextures are used. The SkBitmap's size represents the active region, while the GrTexture's size is the full texture size. This fixes the bicubic image filter GM on the GPU, which otherwise draws garbage outside the filtered region. It also moves us closer to unifying the signatures of SkImageFilter::onFilterImage() and SkImageFilter::filterImageGPU(). Committed: https://code.google.com/p/skia/source/detail?r=7467

Patch Set 1 #

Patch Set 2 : Another approach, using SkBitmap #

Patch Set 3 : Cleanup; fix unrefs; fix blur bug; new -> SkNEW_ARGS #

Patch Set 4 : Refactor getInputResultAsTexture, texture wrapping to SkImageFilterUtils. #

Total comments: 1

Patch Set 5 : Fix comment in SkImageFilterh. #

Patch Set 6 : Fix comment in SkImageFilter.h. #

Total comments: 1

Patch Set 7 : Fix refcounting issues in wrap_texture; add comments. #

Patch Set 8 : Use auto-unreffing GrTextures instead of explicitly unref'ing in WrapTexture(). #

Patch Set 9 : Fix comment #

Patch Set 10 : Switch filterImageGPU() to use an SkBitmap pointer outparam, and return a bool. #

Patch Set 11 : Update to ToT. #

Patch Set 12 : Switch to kSkia8888_GrPixelConfig for filtered textures. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -230 lines) Patch
M gyp/effects.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkImageFilter.h View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -7 lines 1 comment Download
M include/effects/SkBicubicImageFilter.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M include/effects/SkBlendImageFilter.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkBlurImageFilter.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkDisplacementMapEffect.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
A include/effects/SkImageFilterUtils.h View 1 2 3 4 5 6 7 8 9 1 chunk +36 lines, -0 lines 0 comments Download
M include/effects/SkMorphologyImageFilter.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -4 lines 0 comments Download
M include/effects/SkSingleInputImageFilter.h View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
M src/core/SkImageFilter.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 0 comments Download
M src/effects/SkBicubicImageFilter.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +18 lines, -10 lines 0 comments Download
M src/effects/SkBlendImageFilter.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +22 lines, -50 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +13 lines, -5 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +23 lines, -52 lines 0 comments Download
A src/effects/SkImageFilterUtils.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +45 lines, -0 lines 0 comments Download
M src/effects/SkMorphologyImageFilter.cpp View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +30 lines, -13 lines 0 comments Download
M src/effects/SkSingleInputImageFilter.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -40 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +39 lines, -36 lines 0 comments Download

Messages

Total messages: 16
Stephen White
Alternate version. Take a look if you like, but I think I've convinced myself this ...
11 years, 5 months ago (2013-01-22 23:20:52 UTC) #1
bsalomon
On 2013/01/22 23:20:52, Stephen White wrote: > Alternate version. Take a look if you like, ...
11 years, 5 months ago (2013-01-23 15:09:43 UTC) #2
Stephen White
On 2013/01/23 15:09:43, bsalomon wrote: > The bitmap version does seem pretty nice. A few ...
11 years, 5 months ago (2013-01-23 16:14:14 UTC) #3
reed1
https://codereview.appspot.com/7180048/diff/26001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): https://codereview.appspot.com/7180048/diff/26001/include/core/SkImageFilter.h#newcode110 include/core/SkImageFilter.h:110: */ Lets just take a dst-bitmap as an argument, ...
11 years, 5 months ago (2013-01-23 16:36:15 UTC) #4
bsalomon
On 2013/01/23 16:14:14, Stephen White wrote: > On 2013/01/23 15:09:43, bsalomon wrote: > > The ...
11 years, 5 months ago (2013-01-23 16:39:43 UTC) #5
bsalomon
https://codereview.appspot.com/7180048/diff/14001/src/effects/SkImageFilterUtils.cpp File src/effects/SkImageFilterUtils.cpp (right): https://codereview.appspot.com/7180048/diff/14001/src/effects/SkImageFilterUtils.cpp#newcode35 src/effects/SkImageFilterUtils.cpp:35: SkSafeRef(resultTex); Is there a leak here? The pixel ref ...
11 years, 5 months ago (2013-01-23 16:49:54 UTC) #6
Stephen White
On 2013/01/23 16:36:15, reed1 wrote: > https://codereview.appspot.com/7180048/diff/26001/include/core/SkImageFilter.h > File include/core/SkImageFilter.h (right): > > https://codereview.appspot.com/7180048/diff/26001/include/core/SkImageFilter.h#newcode110 > ...
11 years, 5 months ago (2013-01-23 16:51:11 UTC) #7
reed1
sounds good. I think for this API, losing the bool-return is a loss too, since ...
11 years, 5 months ago (2013-01-23 16:54:59 UTC) #8
Stephen White
On 2013/01/23 16:54:59, reed1 wrote: > sounds good. > > I think for this API, ...
11 years, 5 months ago (2013-01-23 16:57:09 UTC) #9
reed1
Understood, but that isn't as clear to the caller, and it (possibly) conflates a failure ...
11 years, 5 months ago (2013-01-23 16:58:19 UTC) #10
Stephen White
On 2013/01/23 16:49:54, bsalomon wrote: > https://codereview.appspot.com/7180048/diff/14001/src/effects/SkImageFilterUtils.cpp > File src/effects/SkImageFilterUtils.cpp (right): > > https://codereview.appspot.com/7180048/diff/14001/src/effects/SkImageFilterUtils.cpp#newcode35 > ...
11 years, 5 months ago (2013-01-23 22:42:12 UTC) #11
Stephen White
On 2013/01/23 16:58:19, reed1 wrote: > Understood, but that isn't as clear to the caller, ...
11 years, 5 months ago (2013-01-24 22:38:16 UTC) #12
reed1
Lets not remove the choice from the caller. Please return a bool and let the ...
11 years, 5 months ago (2013-01-25 13:25:48 UTC) #13
Stephen White
On 2013/01/25 13:25:48, reed1 wrote: > Lets not remove the choice from the caller. Please ...
11 years, 5 months ago (2013-01-30 03:19:07 UTC) #14
bsalomon
lgtm
11 years, 5 months ago (2013-01-30 13:28:24 UTC) #15
reed1
11 years, 5 months ago (2013-01-30 13:52:34 UTC) #16
lgtm w/ comment nit

https://codereview.appspot.com/7180048/diff/33005/include/core/SkImageFilter.h
File include/core/SkImageFilter.h (right):

https://codereview.appspot.com/7180048/diff/33005/include/core/SkImageFilter....
include/core/SkImageFilter.h:109: *  implementation returns an empty SkBitmap.
Comment should read: returns false and ignores result parameter.
Sign in to reply to this message.

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