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

Issue 985583002: Don't cache any SkBitmaps in DeferredImageDecoder (Closed)

Created:
5 years, 9 months ago by Alpha Left Google
Modified:
5 years, 9 months ago
Reviewers:
Stephen White
CC:
blink-reviews, krit, tyoshino+watch_chromium.org, pdr+graphicswatchlist_chromium.org, Dominik Röttsches, dshwang, jbroman, Justin Novosad, danakj, Rik, f(malita), gavinp+loader_chromium.org, Stephen Chennney, Nate Chapin, rwlbuis, reveman
Target Ref:
refs/remotes/origin/master
Project:
blink
Visibility:
Public.

Description

Don't cache any SkBitmaps in DeferredImageDecoder DeferredImageDecoder used to cache SkBitmaps for deferred decoded images. This caused SkPixelRef to be referenced and memory are held by Skia's image cache. Instead DeferredImageDecoder shouldn't cache any SkBitmap. This is now done entirely in BitmapImage. BitmapImage already has a policy when an image exceeds 5MB it will clears its own cache. This will help to free up memory for a large animated image. DeferredImageDecoder used to mimic the ImageDecoder interface. Since ImageSource uses this type directly there is no need for frameBufferAtIndex(). Instead DeferredImageDecoder simply returns a new NativeImageSkia. Re-redecoding for progressive images and animations will be controlled by BitmapImage and there is no need to cache. Some minor cleanups are included: * Remove unused methods from ImageSource and users. * Move definition of animation types to ImageDecoder.h Eventually ImageSource can be folded into BitmapImage or DeferredImageDecoder. BUG=429418 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=191876

Patch Set 1 #

Patch Set 2 : fixed test too #

Patch Set 3 : fixed test #

Total comments: 1

Patch Set 4 : ImageAnimation.h #

Total comments: 1

Patch Set 5 : fixed comments #

Patch Set 6 : merged #

Patch Set 7 : done now #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -216 lines) Patch
M Source/core/fetch/ImageResource.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/fetch/ImageResource.cpp View 1 chunk +0 lines, -12 lines 0 comments Download
M Source/core/fetch/ImageResourceTest.cpp View 1 chunk +0 lines, -6 lines 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/graphics/BitmapImage.h View 1 2 3 2 chunks +1 line, -1 line 0 comments Download
M Source/platform/graphics/BitmapImage.cpp View 1 2 3 4 3 chunks +3 lines, -9 lines 0 comments Download
M Source/platform/graphics/BitmapImageTest.cpp View 1 2 5 chunks +8 lines, -19 lines 0 comments Download
M Source/platform/graphics/DeferredImageDecoder.h View 5 chunks +5 lines, -4 lines 0 comments Download
M Source/platform/graphics/DeferredImageDecoder.cpp View 9 chunks +55 lines, -43 lines 0 comments Download
M Source/platform/graphics/DeferredImageDecoderTest.cpp View 1 2 3 4 5 6 10 chunks +10 lines, -28 lines 0 comments Download
M Source/platform/graphics/ImageSource.h View 3 chunks +3 lines, -25 lines 0 comments Download
M Source/platform/graphics/ImageSource.cpp View 4 chunks +6 lines, -27 lines 0 comments Download
A + Source/platform/image-decoders/ImageAnimation.h View 1 2 3 2 chunks +21 lines, -39 lines 0 comments Download
M Source/platform/image-decoders/ImageDecoder.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/image-decoders/ImageFrame.h View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 15 (6 generated)
Alpha Left Google
Ping.
5 years, 9 months ago (2015-03-13 18:33:59 UTC) #2
Stephen White
Note that the compile failures on the android trybots seem to be related to this ...
5 years, 9 months ago (2015-03-13 19:33:32 UTC) #3
Alpha Left Google
On 2015/03/13 19:33:32, Stephen White wrote: > Note that the compile failures on the android ...
5 years, 9 months ago (2015-03-13 20:14:47 UTC) #4
Stephen White
LGTM w/nit https://codereview.chromium.org/985583002/diff/60001/Source/platform/graphics/BitmapImage.cpp File Source/platform/graphics/BitmapImage.cpp (right): https://codereview.chromium.org/985583002/diff/60001/Source/platform/graphics/BitmapImage.cpp#newcode600 Source/platform/graphics/BitmapImage.cpp:600: // because it is 0 (see comments ...
5 years, 9 months ago (2015-03-13 20:21:41 UTC) #5
Alpha Left Google
On 2015/03/13 20:21:41, Stephen White wrote: > LGTM w/nit > > https://codereview.chromium.org/985583002/diff/60001/Source/platform/graphics/BitmapImage.cpp > File Source/platform/graphics/BitmapImage.cpp ...
5 years, 9 months ago (2015-03-13 20:45:00 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/985583002/100001
5 years, 9 months ago (2015-03-13 20:52:48 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: android_blink_compile_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/android_blink_compile_dbg/builds/31384)
5 years, 9 months ago (2015-03-13 21:32:13 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/985583002/120001
5 years, 9 months ago (2015-03-13 23:11:43 UTC) #14
commit-bot: I haz the power
5 years, 9 months ago (2015-03-14 05:00:26 UTC) #15
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=191876

Powered by Google App Engine
This is Rietveld 408576698