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

Issue 1145893007: Fixing leaky handling of SkImage in SkDeferredCanvas. (Closed)

Created:
5 years, 6 months ago by Justin Novosad
Modified:
5 years, 6 months ago
Reviewers:
reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Fixing leaky handling of SkImage in SkDeferredCanvas. Long lived SkImageHeap objects currently accumulate refs indefinitely. This leads to massive memory leaks in the gpu-accelerated 2D canvas code path. This CL does not implement a general fix for SkGPipe, but it resolves the leak in SkDeferredCanvas (currently the only user of SkGPipe) by resetting the image heap when the deferral queue is flushed. This change also fixes the accounting of bytes allocated by referenced images in order to trigger flushing heuristics appropriately. BUG=crbug.com/494148 Committed: https://skia.googlesource.com/skia/+/d26c9fa66c45b5a050580772acfbcc1b5271543e

Patch Set 1 #

Total comments: 4

Patch Set 2 : reed feedback #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -2 lines) Patch
M include/pipe/SkGPipe.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/pipe/SkGPipePriv.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M src/pipe/SkGPipeWrite.cpp View 1 6 chunks +34 lines, -2 lines 1 comment Download
M src/utils/SkDeferredCanvas.cpp View 1 1 chunk +2 lines, -0 lines 0 comments Download
M tests/DeferredCanvasTest.cpp View 2 chunks +17 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (4 generated)
Justin Novosad
PTAL
5 years, 6 months ago (2015-06-01 21:51:59 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1145893007/1
5 years, 6 months ago (2015-06-01 21:52:14 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 6 months ago (2015-06-01 23:54:31 UTC) #6
Justin Novosad
FWIW, the more general solution would be to do what SkBitmapHeap does: maintain a counter ...
5 years, 6 months ago (2015-06-02 01:55:48 UTC) #7
reed1
Can we document somewhere (skia bug?) how/why the imageheap and bitmapheaps differ in how they ...
5 years, 6 months ago (2015-06-02 14:35:42 UTC) #8
Justin Novosad
created skbug for follow-up: https://code.google.com/p/skia/issues/detail?id=3884 https://codereview.chromium.org/1145893007/diff/1/include/pipe/SkGPipe.h File include/pipe/SkGPipe.h (right): https://codereview.chromium.org/1145893007/diff/1/include/pipe/SkGPipe.h#newcode90 include/pipe/SkGPipe.h:90: void resetImageHeap(); On 2015/06/02 ...
5 years, 6 months ago (2015-06-02 16:50:34 UTC) #9
reed1
lgtm
5 years, 6 months ago (2015-06-02 17:07:52 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1145893007/20001
5 years, 6 months ago (2015-06-02 18:42:15 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/d26c9fa66c45b5a050580772acfbcc1b5271543e
5 years, 6 months ago (2015-06-02 18:47:52 UTC) #13
reed1
https://codereview.chromium.org/1145893007/diff/20001/src/pipe/SkGPipeWrite.cpp File src/pipe/SkGPipeWrite.cpp (right): https://codereview.chromium.org/1145893007/diff/20001/src/pipe/SkGPipeWrite.cpp#newcode1452 src/pipe/SkGPipeWrite.cpp:1452: printf("Images reff'ed: %d \n", fArray.count()); EEEEK!
5 years, 6 months ago (2015-06-04 13:20:39 UTC) #14
Justin Novosad
5 years, 6 months ago (2015-06-04 15:02:14 UTC) #15
Message was sent while issue was closed.
On 2015/06/04 13:20:39, reed1 wrote:
>
https://codereview.chromium.org/1145893007/diff/20001/src/pipe/SkGPipeWrite.cpp
> File src/pipe/SkGPipeWrite.cpp (right):
> 
>
https://codereview.chromium.org/1145893007/diff/20001/src/pipe/SkGPipeWrite.c...
> src/pipe/SkGPipeWrite.cpp:1452: printf("Images reff'ed: %d \n",
fArray.count());
> EEEEK!

Sorry 'bout that

Powered by Google App Engine
This is Rietveld 408576698