|
Fix filter primitive bounds computations.
Make each filter responsible for expanding its destination
bounds. Previously, we were using a union of all
intermediate bounds sizes via join() calls in many image
filters' computeFastBounds(), due to the fact that those
filters could only produce bitmaps the same size as their
inputs. Now, we compute optimal bounds for each filter as
follows:
1) Pass the (unmodified) clip bounds to the root node
of the DAG in the first recursive call to onFilterImage()
as the Context's fClipBounds.
2) Reverse-map the clip: when recursing up the DAG in
filterInput[GPU](), apply filter-specific expansion to the
clip by calling calling onFilterNodeBounds(... kReverse).
This allows upstream nodes to have a clip that respects the
current node's requirements. This is done via helper
function mapContext().
3) Forward-map the source bitmap: just prior to applying
the crop rect in applyCropRect(), we determine the filter's
preferred bounds by mapping the source bitmap bounds
forwards via onFilterNodeBounds(..., kForward).
NOTE: GMs affected by this change:
fast_slow_blurimagefilter: fast and slow paths now produce the same result
spritebitmap: drawSprite() and drawBitmap() paths now produce the same result
filterfastbounds: fast bounds are optimized; all drop-shadow results now appear
apply-filter: snug and not-snug cases give same results
dropshadowimagefilter: drawSprite() results now show shadows
draw-with-filter: no artifacts on erode edges; blur edges no longer clipped
displacement, imagefiltersbase, imagefiltersclipped, imagefilterscropexpand, imagefiltersscaled, matriximagefilter,
resizeimagefilter, localmatriximagefilter, testimagefilters: fixed incorrect clipping
imagefilterstransformed, morphology: no artifacts on erode edges
BUG= skia:1062, skia:3194, skia:3939, skia:4337, skia:4526
Committed: https://skia.googlesource.com/skia/+/db64af3b178a19ecb47d2b9a373113687d8921fd
Total comments: 5
Total comments: 4
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+209 lines, -102 lines) |
Patch |
|
M |
include/core/SkImageFilter.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
2 chunks |
+27 lines, -0 lines |
0 comments
|
Download
|
|
M |
include/effects/SkBlurImageFilter.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
include/effects/SkDisplacementMapEffect.h
|
View
|
5
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
include/effects/SkDropShadowImageFilter.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
include/effects/SkMatrixConvolutionImageFilter.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
include/effects/SkMorphologyImageFilter.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
include/effects/SkOffsetImageFilter.h
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
include/effects/SkTileImageFilter.h
|
View
|
1
2
3
5
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/core/SkCanvas.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
3 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/core/SkDevice.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/core/SkImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
5 chunks |
+38 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/core/SkMatrixImageFilter.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/core/SkMatrixImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
1 chunk |
+16 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/core/SkRecordDraw.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
3 chunks |
+8 lines, -0 lines |
6 comments
|
Download
|
|
M |
src/effects/SkBlurImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
3 chunks |
+13 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/effects/SkComposeImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
src/effects/SkDisplacementMapEffect.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
1 chunk |
+11 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/effects/SkDropShadowImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+11 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/effects/SkMatrixConvolutionImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
2 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/effects/SkMorphologyImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
3 chunks |
+6 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/effects/SkOffsetImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
1 chunk |
+14 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/effects/SkTileImageFilter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
1 chunk |
+15 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/gpu/SkGpuDevice.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
2 chunks |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
tests/ImageFilterTest.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
Total messages: 62 (32 generated)
|