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

Issue 5322068: Gaussian blurs for images (Closed)

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

Description

Implement optional Gaussian image blurs on saveLayer()/restore(). The caller creates an an SkBlurImageFilter, sets it on an SkPaint, passes that paint to saveLayer(), draws the primitives which are to be blurred, then restore(), which applies the blur. The blurs have separate sizes in the horizontal and vertical direction. This feature is GPU-only for now. The original soft shadows code was refactored to allow it to be applied to an input GrTexture, and to apply X and Y sigma separately. In the soft shadows implementation, clipping is now done in the pre-downsampled coordinate space. The temporary textures used for downsampling and blurring are now allocated without stencil, which should save on VRAM. When doing one of the special blur modes in soft shadows, we also preserve the originally-drawn texture, saving a copy to a temporary. At Brian's suggestion, this change also turns on GR_AGGRESSIVE_SHADER_OPTS in SampleApp, since it's also on in Chrome. NB: Due to the clipping change, there are slight pixel differences on the blurs_gpu and shadows_gpu tests, so those will require rebaselining on all platforms, as will some of the WebKit layout tests (TBD).

Patch Set 1 #

Patch Set 2 : Update to new SkPaint/SkImageFilter API #

Total comments: 3

Patch Set 3 : Change SkBlurImageFilter constructor as per review #

Patch Set 4 : Moved drawing to drawDevice() to use save/restore; changed sample to GM #

Patch Set 5 : Remove some commented-out includes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+293 lines, -130 lines) Patch
gm/imageblur.cpp View 1 2 3 4 1 chunk +57 lines, -0 lines 0 comments Download
gyp/effects.gyp View 1 2 chunks +2 lines, -0 lines 0 comments Download
gyp/gmslides.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
include/effects/SkBlurImageFilter.h View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
include/gpu/GrConfig.h View 1 1 chunk +1 line, -1 line 0 comments Download
src/effects/SkBlurImageFilter.cpp View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
src/gpu/GrContext.cpp View 1 3 chunks +4 lines, -4 lines 0 comments Download
src/gpu/SkGpuDevice.cpp View 1 2 3 8 chunks +187 lines, -125 lines 0 comments Download

Messages

Total messages: 12
Stephen White
12 years, 7 months ago (2011-11-02 19:31:58 UTC) #1
reed1
Why do we need to add fields to SkPaint? Can this be triggered via a ...
12 years, 7 months ago (2011-11-02 19:42:08 UTC) #2
Stephen White
On 2011/11/02 19:42:08, reed1 wrote: > Why do we need to add fields to SkPaint? ...
12 years, 7 months ago (2011-11-02 20:47:56 UTC) #3
Stephen White
Update to new SkPaint/SkImageFilter API
12 years, 7 months ago (2011-11-03 20:31:02 UTC) #4
reed1
Defer to brian for the bulk of the changes. Lets be sure you can iterate ...
12 years, 7 months ago (2011-11-03 20:40:52 UTC) #5
Stephen White
Change SkBlurImageFilter constructor as per review
12 years, 7 months ago (2011-11-03 21:02:27 UTC) #6
bsalomon
It's great that the existing blur shader code can be used to implement the image ...
12 years, 7 months ago (2011-11-03 21:46:30 UTC) #7
Stephen White
Thanks for the review. On 2011/11/03 21:46:30, bsalomon wrote: > It's great that the existing ...
12 years, 7 months ago (2011-11-04 14:54:53 UTC) #8
Stephen White
Moved drawing to drawDevice() to use save/restore; changed sample to GM
12 years, 7 months ago (2011-11-04 19:08:58 UTC) #9
Stephen White
Remove some commented-out includes
12 years, 7 months ago (2011-11-04 19:10:50 UTC) #10
bsalomon
LGTM
12 years, 7 months ago (2011-11-07 17:42:22 UTC) #11
Stephen White
12 years, 5 months ago (2012-01-03 22:54:31 UTC) #12
On 2011/11/07 17:42:22, bsalomon wrote:
> LGTM

This landed way back in the mists of time, aka r2643.  Closing.
Sign in to reply to this message.

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