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

Issue 19393004: Allow eviction of ImageBitmaps that are created from ImageElements. (Closed)

Created:
7 years, 5 months ago by arbesfeld
Modified:
7 years, 4 months ago
CC:
blink-reviews, aandrey+blink_chromium.org, dglazkov+blink, Rik, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

Allow eviction of ImageBitmaps that are created from ImageElements. We hold a reference to the HTMLImageElement in the ImageBitmap but elevate the priority of its CachedResource. Cropping is handled at drawing time. Some style changes are also being introduced in this patch. BUG=259947, 166658 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155546 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155629

Patch Set 1 #

Patch Set 2 : Remove old comment. #

Total comments: 3

Patch Set 3 : Add DecodeCachePriority for CachedResource. ImageBitmaps have elevated DecodeCachePriority. #

Patch Set 4 : #

Total comments: 14

Patch Set 5 : Use CachedImage as the backing store for ImageBitmap. Implement O(1) decode cache. #

Total comments: 8

Patch Set 6 : Notify ImageBitmap when source HTMLImageElement changes. Fix ImageBitmap double cropping. #

Patch Set 7 : Style changes. #

Patch Set 8 : More style changes. #

Patch Set 9 : Fix drawImage out of bounds src rect. #

Total comments: 9

Patch Set 10 : #

Patch Set 11 : Decrease canvas size for recursive test. #

Total comments: 6

Patch Set 12 : Move priority assignment into ImageLoader #

Total comments: 1

Patch Set 13 : Name change. #

Total comments: 1

Patch Set 14 : #

Patch Set 15 : Rebase. #

Patch Set 16 : Rebase. #

Patch Set 17 : Change capacities to satisfy assertions. #

Patch Set 18 : Rebase tests to use promises. #

Patch Set 19 : Rebase. #

Patch Set 20 : Fix for assertion failure. #

Patch Set 21 : Fix for assertion failure. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1283 lines, -796 lines) Patch
M LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +1 line, -29 lines 0 comments Download
M LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +4 lines, -629 lines 0 comments Download
A LayoutTests/fast/canvas/canvas-createImageBitmap-immutable.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +105 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/canvas-createImageBitmap-immutable-expected.html View 1 2 3 4 5 6 7 8 9 1 chunk +21 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +64 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src-expected.html View 1 2 3 4 5 6 7 8 9 1 chunk +64 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/canvas-createImageBitmap-recursive.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +138 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/canvas-createImageBitmap-recursive-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +489 lines, -0 lines 0 comments Download
M Source/core/html/HTMLImageElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +23 lines, -16 lines 0 comments Download
M Source/core/loader/ImageLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +18 lines, -0 lines 0 comments Download
M Source/core/loader/ImageLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +32 lines, -0 lines 0 comments Download
M Source/core/loader/cache/CachedImageTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -30 lines 0 comments Download
M Source/core/loader/cache/MemoryCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +7 lines, -2 lines 0 comments Download
M Source/core/loader/cache/MemoryCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +40 lines, -31 lines 0 comments Download
M Source/core/loader/cache/MemoryCacheTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +85 lines, -0 lines 0 comments Download
A Source/core/loader/cache/MockCachedImageClient.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +72 lines, -0 lines 0 comments Download
M Source/core/loader/cache/Resource.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +10 lines, -1 line 0 comments Download
M Source/core/loader/cache/Resource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +12 lines, -1 line 0 comments Download
M Source/core/page/ImageBitmap.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +30 lines, -26 lines 0 comments Download
M Source/core/page/ImageBitmap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +64 lines, -31 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
arbesfeld
We only hold a reference to the HTMLImageElement so the cache should be able to ...
7 years, 5 months ago (2013-07-16 19:24:40 UTC) #1
Justin Novosad
QQ: what is the impact of this change on the performance of the many images ...
7 years, 5 months ago (2013-07-16 22:45:21 UTC) #2
arbesfeld
On 2013/07/16 22:45:21, junov wrote: > QQ: what is the impact of this change on ...
7 years, 5 months ago (2013-07-16 22:54:19 UTC) #3
Justin Novosad
On 2013/07/16 22:54:19, arbesfeld wrote: > On 2013/07/16 22:45:21, junov wrote: > > QQ: what ...
7 years, 5 months ago (2013-07-16 23:05:38 UTC) #4
Justin Novosad
https://codereview.chromium.org/19393004/diff/3001/Source/core/page/ImageBitmap.cpp File Source/core/page/ImageBitmap.cpp (right): https://codereview.chromium.org/19393004/diff/3001/Source/core/page/ImageBitmap.cpp#newcode108 Source/core/page/ImageBitmap.cpp:108: m_bitmap = cropImage(bitmapImage.get(), adjustedCropRect); You can do better here. ...
7 years, 5 months ago (2013-07-16 23:05:53 UTC) #5
Justin Novosad
Overall, I think this patch is on the right track, but we need tests to ...
7 years, 5 months ago (2013-07-16 23:09:07 UTC) #6
arbesfeld
Please take a look at this patch.
7 years, 5 months ago (2013-07-17 23:14:16 UTC) #7
Justin Novosad
https://codereview.chromium.org/19393004/diff/15001/Source/core/loader/cache/CachedImage.cpp File Source/core/loader/cache/CachedImage.cpp (right): https://codereview.chromium.org/19393004/diff/15001/Source/core/loader/cache/CachedImage.cpp#newcode406 Source/core/loader/cache/CachedImage.cpp:406: // produces a different image, m_image != image for ...
7 years, 5 months ago (2013-07-19 21:09:53 UTC) #8
arbesfeld
On 2013/07/19 21:09:53, junov wrote: > https://codereview.chromium.org/19393004/diff/15001/Source/core/loader/cache/CachedImage.cpp > File Source/core/loader/cache/CachedImage.cpp (right): > > https://codereview.chromium.org/19393004/diff/15001/Source/core/loader/cache/CachedImage.cpp#newcode406 > ...
7 years, 5 months ago (2013-07-22 21:50:50 UTC) #9
Justin Novosad
On 2013/07/22 21:50:50, arbesfeld wrote: > > > The style checker tells me "Please declare ...
7 years, 5 months ago (2013-07-23 15:35:48 UTC) #10
Justin Novosad
https://codereview.chromium.org/19393004/diff/28001/Source/core/loader/cache/CachedResource.cpp File Source/core/loader/cache/CachedResource.cpp (left): https://codereview.chromium.org/19393004/diff/28001/Source/core/loader/cache/CachedResource.cpp#oldcode554 Source/core/loader/cache/CachedResource.cpp:554: Don't do whitespace edits unless you are changing the ...
7 years, 5 months ago (2013-07-23 16:55:12 UTC) #11
arbesfeld
New patch. The HTMLImageElement notifies the ImageBitmap when its source image changes so that the ...
7 years, 5 months ago (2013-07-24 22:06:14 UTC) #12
Justin Novosad
On 2013/07/24 22:06:14, arbesfeld wrote: > New patch. The HTMLImageElement notifies the ImageBitmap when its ...
7 years, 5 months ago (2013-07-25 15:23:58 UTC) #13
arbesfeld
Ok, I added a test to check that which assumes that canvas to canvas draws ...
7 years, 5 months ago (2013-07-25 15:47:47 UTC) #14
Justin Novosad
On 2013/07/25 15:47:47, arbesfeld wrote: > Ok, I added a test to check that which ...
7 years, 5 months ago (2013-07-25 17:30:24 UTC) #15
Stephen White
I don't feel qualified to review all of this, so I've added japhet@ for the ...
7 years, 5 months ago (2013-07-25 18:01:06 UTC) #16
arbesfeld
Thanks. > https://codereview.chromium.org/19393004/diff/45001/LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src-expected.html > File > LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src-expected.html > (right): > > https://codereview.chromium.org/19393004/diff/45001/LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src-expected.html#newcode3 > LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src-expected.html:3: > ...
7 years, 5 months ago (2013-07-25 18:30:57 UTC) #17
arbesfeld
The canvas-createImageBitmap-recursive test was timing out so I decreased the dimensions of the canvas.
7 years, 5 months ago (2013-07-26 15:47:58 UTC) #18
Nate Chapin
https://codereview.chromium.org/19393004/diff/69001/Source/core/loader/cache/CachedResource.h File Source/core/loader/cache/CachedResource.h (right): https://codereview.chromium.org/19393004/diff/69001/Source/core/loader/cache/CachedResource.h#newcode83 Source/core/loader/cache/CachedResource.h:83: enum CachePriority { I know there was already debate ...
7 years, 5 months ago (2013-07-26 17:05:11 UTC) #19
Justin Novosad
https://codereview.chromium.org/19393004/diff/69001/Source/core/page/ImageBitmap.cpp File Source/core/page/ImageBitmap.cpp (right): https://codereview.chromium.org/19393004/diff/69001/Source/core/page/ImageBitmap.cpp#newcode40 Source/core/page/ImageBitmap.cpp:40: m_imageElement->cachedImage()->setCachePriority(CachedResource::CachePriorityHigh); On 2013/07/26 17:05:12, Nate Chapin wrote: > Is ...
7 years, 4 months ago (2013-07-29 14:57:59 UTC) #20
arbesfeld
Great suggestions. New patch up for review.
7 years, 4 months ago (2013-07-29 15:20:02 UTC) #21
Justin Novosad
https://codereview.chromium.org/19393004/diff/78001/Source/core/loader/ImageLoader.h File Source/core/loader/ImageLoader.h (right): https://codereview.chromium.org/19393004/diff/78001/Source/core/loader/ImageLoader.h#newcode39 Source/core/loader/ImageLoader.h:39: virtual bool isHighPriorityImageLoaderClient() = 0; the "ImageLoaderClient" part of ...
7 years, 4 months ago (2013-07-29 15:29:43 UTC) #22
arbesfeld
On 2013/07/29 15:29:43, junov wrote: > https://codereview.chromium.org/19393004/diff/78001/Source/core/loader/ImageLoader.h > File Source/core/loader/ImageLoader.h (right): > > https://codereview.chromium.org/19393004/diff/78001/Source/core/loader/ImageLoader.h#newcode39 > ...
7 years, 4 months ago (2013-07-29 17:28:49 UTC) #23
Justin Novosad
https://codereview.chromium.org/19393004/diff/86001/Source/core/loader/ImageLoader.cpp File Source/core/loader/ImageLoader.cpp (right): https://codereview.chromium.org/19393004/diff/86001/Source/core/loader/ImageLoader.cpp#newcode434 Source/core/loader/ImageLoader.cpp:434: if (m_image) Better to only call setCacheLiveResourcePriority if necessary. ...
7 years, 4 months ago (2013-07-29 17:47:57 UTC) #24
arbesfeld
Done.
7 years, 4 months ago (2013-07-29 18:04:02 UTC) #25
arbesfeld
New patch for review.
7 years, 4 months ago (2013-07-30 18:46:14 UTC) #26
Justin Novosad
Looks fine to me. Nate, anything to add?
7 years, 4 months ago (2013-07-30 19:04:00 UTC) #27
arbesfeld
Re-based the tests to use Promises. I still need a Blink OWNER to sign off. ...
7 years, 4 months ago (2013-08-02 15:10:22 UTC) #28
Nate Chapin
LGTM
7 years, 4 months ago (2013-08-05 17:49:09 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/arbesfeld@chromium.org/19393004/119001
7 years, 4 months ago (2013-08-05 18:17:14 UTC) #30
commit-bot: I haz the power
Change committed as 155546
7 years, 4 months ago (2013-08-05 22:27:06 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/arbesfeld@chromium.org/19393004/137001
7 years, 4 months ago (2013-08-06 15:17:48 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/arbesfeld@chromium.org/19393004/137001
7 years, 4 months ago (2013-08-06 15:19:50 UTC) #33
commit-bot: I haz the power
7 years, 4 months ago (2013-08-06 20:07:57 UTC) #34
Message was sent while issue was closed.
Change committed as 155629

Powered by Google App Engine
This is Rietveld 408576698