Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Issue 1008043002: [S.P.] Don't draw frames of animated images that are offscreen. (Closed)

Created:
5 years, 9 months ago by chrishtr
Modified:
5 years, 9 months ago
Reviewers:
esprehn, Xianzhu, enne (OOO)
CC:
blink-reviews, blink-reviews-rendering, Dominik Röttsches, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

[S.P.] Don't draw frames of animated images that are offscreen. To achieve this, introduces the notion of a delayed paint invalidation. When invalidating paint for an object, the object now has the option to delay the invalidation until the next frame. BUG=440466 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192219

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 14

Patch Set 7 : #

Patch Set 8 : #

Total comments: 2

Patch Set 9 : #

Patch Set 10 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -19 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/VirtualTestSuites View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M LayoutTests/fast/repaint/resources/text-based-repaint.js View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/paint/invalidation/animated-gif.html View 1 2 3 4 5 6 1 chunk +15 lines, -0 lines 0 comments Download
A + LayoutTests/paint/invalidation/animated-gif-expected.txt View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download
A LayoutTests/paint/invalidation/animated-gif-offscreen.html View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download
A + LayoutTests/paint/invalidation/animated-gif-offscreen-expected.txt View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download
A + LayoutTests/virtual/slimmingpaint/paint/README.txt View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
A + LayoutTests/virtual/slimmingpaint/paint/invalidation/animated-gif-expected.txt View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
A + LayoutTests/virtual/slimmingpaint/paint/invalidation/animated-gif-offscreen-expected.txt View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/layout/LayoutBoxModelObject.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -1 line 0 comments Download
M Source/core/layout/LayoutImage.h View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutImage.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +25 lines, -0 lines 2 comments Download
M Source/core/layout/LayoutObject.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -3 lines 2 comments Download
M Source/platform/graphics/PaintInvalidationReason.h View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M Source/platform/graphics/PaintInvalidationReason.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (7 generated)
chrishtr
5 years, 9 months ago (2015-03-14 00:46:08 UTC) #2
chrishtr
Testing is clearly not done for this CL. Sending now for code feedback.
5 years, 9 months ago (2015-03-14 00:46:26 UTC) #3
chrishtr
https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutImage.cpp File Source/core/layout/LayoutImage.cpp (right): https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutImage.cpp#newcode200 Source/core/layout/LayoutImage.cpp:200: return PaintInvalidationDelayedFull; Since this method overrides invalidatePaintIfNeeded, in the ...
5 years, 9 months ago (2015-03-16 23:07:41 UTC) #4
Xianzhu
I guess the latest patch set is not a working one yet, because there is ...
5 years, 9 months ago (2015-03-17 23:34:01 UTC) #5
chrishtr
On 2015/03/17 at 23:34:01, wangxianzhu wrote: > I guess the latest patch set is not ...
5 years, 9 months ago (2015-03-17 23:53:56 UTC) #6
chrishtr
https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutImage.cpp File Source/core/layout/LayoutImage.cpp (right): https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutImage.cpp#newcode200 Source/core/layout/LayoutImage.cpp:200: return PaintInvalidationDelayedFull; On 2015/03/16 at 23:07:41, chrishtr wrote: > ...
5 years, 9 months ago (2015-03-17 23:55:56 UTC) #7
Xianzhu
lgtm (with the assertions for non-SP restored). https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutObject.cpp File Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutObject.cpp#newcode1206 Source/core/layout/LayoutObject.cpp:1206: setShouldDoFullPaintInvalidation(); On ...
5 years, 9 months ago (2015-03-18 16:37:02 UTC) #8
Xianzhu
Several nits. And please also make the test work. https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutObject.cpp File Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/1008043002/diff/100001/Source/core/layout/LayoutObject.cpp#newcode1280 Source/core/layout/LayoutObject.cpp:1280: ...
5 years, 9 months ago (2015-03-18 19:24:53 UTC) #9
chrishtr
Test is now working. Added two tests, one for a visible animated gif, and one ...
5 years, 9 months ago (2015-03-19 22:01:27 UTC) #10
Xianzhu
lgtm. https://codereview.chromium.org/1008043002/diff/140001/Source/core/paint/ImagePainter.cpp File Source/core/paint/ImagePainter.cpp (right): https://codereview.chromium.org/1008043002/diff/140001/Source/core/paint/ImagePainter.cpp#newcode130 Source/core/paint/ImagePainter.cpp:130: fprintf(stderr, "painting image\n"); Remove.
5 years, 9 months ago (2015-03-19 22:14:22 UTC) #11
chrishtr
https://codereview.chromium.org/1008043002/diff/140001/Source/core/paint/ImagePainter.cpp File Source/core/paint/ImagePainter.cpp (right): https://codereview.chromium.org/1008043002/diff/140001/Source/core/paint/ImagePainter.cpp#newcode130 Source/core/paint/ImagePainter.cpp:130: fprintf(stderr, "painting image\n"); On 2015/03/19 at 22:14:22, Xianzhu wrote: ...
5 years, 9 months ago (2015-03-19 22:15:16 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1008043002/160001
5 years, 9 months ago (2015-03-19 22:17:04 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_compile_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_compile_dbg/builds/39144) mac_blink_rel on tryserver.blink (JOB_FAILED, ...
5 years, 9 months ago (2015-03-19 22:20:07 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1008043002/180001
5 years, 9 months ago (2015-03-19 22:36:41 UTC) #20
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://src.chromium.org/viewvc/blink?view=rev&revision=192219
5 years, 9 months ago (2015-03-20 01:56:51 UTC) #21
esprehn
https://codereview.chromium.org/1008043002/diff/180001/Source/core/layout/LayoutImage.cpp File Source/core/layout/LayoutImage.cpp (right): https://codereview.chromium.org/1008043002/diff/180001/Source/core/layout/LayoutImage.cpp#newcode196 Source/core/layout/LayoutImage.cpp:196: return LayoutReplaced::invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationContainer); It might be nice to paint ...
5 years, 9 months ago (2015-03-20 06:52:32 UTC) #23
yurys
A revert of this CL (patchset #10 id:180001) has been created in https://codereview.chromium.org/1025603002/ by yurys@chromium.org. ...
5 years, 9 months ago (2015-03-20 08:54:04 UTC) #24
chrishtr
5 years, 9 months ago (2015-03-20 16:44:45 UTC) #25
Message was sent while issue was closed.
https://codereview.chromium.org/1008043002/diff/180001/Source/core/layout/Lay...
File Source/core/layout/LayoutImage.cpp (right):

https://codereview.chromium.org/1008043002/diff/180001/Source/core/layout/Lay...
Source/core/layout/LayoutImage.cpp:196: return
LayoutReplaced::invalidatePaintIfNeeded(paintInvalidationState,
paintInvalidationContainer);
On 2015/03/20 at 06:52:32, esprehn wrote:
> It might be nice to paint the first frame of an animated image, otherwise if
you scroll fast you might see the content behind the image in the prepaint area.

That is indeed a bug in this version, thanks for pointing it out. Will fix.

https://codereview.chromium.org/1008043002/diff/180001/Source/core/layout/Lay...
File Source/core/layout/LayoutObject.cpp (left):

https://codereview.chromium.org/1008043002/diff/180001/Source/core/layout/Lay...
Source/core/layout/LayoutObject.cpp:3120: ASSERT(document().lifecycle().state()
!= DocumentLifecycle::InPaintInvalidation);
On 2015/03/20 at 06:52:32, esprehn wrote:
> Are you sure this is safe? Calling markContainerChainForPaintInvalidation
inside paint invalidation seems like it would leave dirty bits in the tree.

Good point, this assert is still valuable for preventing other bad use. I'll
adjust it.

Powered by Google App Engine
This is Rietveld 408576698