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

Issue 44253005: 2D Canvas: Refactor code re-attempting to allocate an imageBuffer. (Closed)

Created:
7 years, 1 month ago by dshwang
Modified:
7 years, 1 month ago
CC:
blink-reviews, aandrey+blink_chromium.org, dglazkov+blink, Rik, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@convertL
Visibility:
Public.

Description

2D Canvas: Refactor code re-attempting to allocate an imageBuffer. m_hasCreatedImageBuffer prevents HTMLCanvasElement::buffer() from continuously re-attempting to allocate an imageBuffer after the first attempt failed. This has huge implications for performance in low memory conditions. m_hasCreatedImageBuffer was misnamed, so it ended-up being misused in several places. This CL renames m_hasCreatedImageBuffer to m_didFailToCreateImageBuffer, and then m_didFailToCreateImageBuffer is used in only relevant places. TEST=fast/canvas/canvas-extremely-large-dimensions.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162330

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : remove stale comment #

Patch Set 4 : Clean up code re-attempting to allocate an imageBuffer. #

Patch Set 5 : Use extremely instead of insanely. Amend test a bit. #

Total comments: 7

Patch Set 6 : Fix grammar nits. change 10000 to 100. #

Patch Set 7 : Merge with CL 74533004 to test on win and mac. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -18 lines) Patch
A + LayoutTests/fast/canvas/canvas-extremely-large-dimensions.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/canvas/canvas-extremely-large-dimensions-expected.txt View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A LayoutTests/fast/canvas/script-tests/canvas-extremely-large-dimensions.js View 1 2 3 4 5 1 chunk +85 lines, -0 lines 0 comments Download
M Source/core/html/HTMLCanvasElement.h View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 11 chunks +15 lines, -13 lines 0 comments Download
M Source/core/html/canvas/CanvasRenderingContext2D.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 24 (0 generated)
dshwang
7 years, 1 month ago (2013-10-25 18:29:20 UTC) #1
aandrey
https://codereview.chromium.org/44253005/diff/40001/Source/core/html/HTMLCanvasElement.h File Source/core/html/HTMLCanvasElement.h (left): https://codereview.chromium.org/44253005/diff/40001/Source/core/html/HTMLCanvasElement.h#oldcode172 Source/core/html/HTMLCanvasElement.h:172: // m_createdImageBuffer means we tried to malloc the buffer. ...
7 years, 1 month ago (2013-10-25 20:03:35 UTC) #2
dshwang
On 2013/10/25 20:03:35, aandrey wrote: > https://codereview.chromium.org/44253005/diff/40001/Source/core/html/HTMLCanvasElement.h > File Source/core/html/HTMLCanvasElement.h (left): > > https://codereview.chromium.org/44253005/diff/40001/Source/core/html/HTMLCanvasElement.h#oldcode172 > ...
7 years, 1 month ago (2013-10-25 20:41:05 UTC) #3
Justin Novosad
not lgtm m_hasCreatedImageBuffer is very useful. It prevents HTMLCanvasElement::buffer() from continuously re-attempting to allocate an ...
7 years, 1 month ago (2013-10-25 21:51:18 UTC) #4
Justin Novosad
On 2013/10/25 21:51:18, junov wrote: > This has huge implications for performance in low memory ...
7 years, 1 month ago (2013-10-25 21:54:20 UTC) #5
dshwang
On 2013/10/25 21:54:20, junov wrote: > On 2013/10/25 21:51:18, junov wrote: > > This has ...
7 years, 1 month ago (2013-10-25 23:53:47 UTC) #6
Justin Novosad
On 2013/10/25 23:53:47, dshwang wrote: > On 2013/10/25 21:54:20, junov wrote: > > On 2013/10/25 ...
7 years, 1 month ago (2013-10-28 14:21:20 UTC) #7
dshwang
On 2013/10/28 14:21:20, junov wrote: > Furthermore, since this change fixes a bug, please add ...
7 years, 1 month ago (2013-10-28 14:41:36 UTC) #8
dshwang
Hi, long time no see :) I update this CL as junov@ advised. and reuse ...
7 years, 1 month ago (2013-11-18 19:51:07 UTC) #9
Justin Novosad
On 2013/11/18 19:51:07, dshwang wrote: > Hi, long time no see :) > > I ...
7 years, 1 month ago (2013-11-18 20:01:48 UTC) #10
dshwang
On 2013/11/18 20:01:48, junov wrote: > I just have one minor change to suggest: "insanely" ...
7 years, 1 month ago (2013-11-18 20:28:07 UTC) #11
Stephen White
Thanks for the patch. My comments are mostly just spelling/grammar nits. https://codereview.chromium.org/44253005/diff/230001/LayoutTests/fast/canvas/script-tests/canvas-extremely-large-dimensions.js File LayoutTests/fast/canvas/script-tests/canvas-extremely-large-dimensions.js (right): ...
7 years, 1 month ago (2013-11-18 21:42:13 UTC) #12
dshwang
On 2013/11/18 21:42:13, Stephen White wrote: > Thanks for the patch. My comments are mostly ...
7 years, 1 month ago (2013-11-19 10:05:07 UTC) #13
dshwang
I found more related to this CL. We don't create extremely big image buffer already. ...
7 years, 1 month ago (2013-11-19 10:47:10 UTC) #14
dshwang
On 2013/11/19 10:47:10, dshwang wrote: > Which is better: retaining m_didFailToCreateImageBuffer or removing > m_didFailToCreateImageBuffer? ...
7 years, 1 month ago (2013-11-19 12:33:37 UTC) #15
dshwang
Oops, sorry. I correct my mentions again. The test is vaild. regardless of why failing ...
7 years, 1 month ago (2013-11-19 13:08:49 UTC) #16
Stephen White
On 2013/11/19 13:08:49, dshwang wrote: > Oops, sorry. I correct my mentions again. > > ...
7 years, 1 month ago (2013-11-19 14:12:54 UTC) #17
dshwang
On 2013/11/19 14:12:54, Stephen White wrote: > On 2013/11/19 13:08:49, dshwang wrote: > > Oops, ...
7 years, 1 month ago (2013-11-19 14:21:53 UTC) #18
Stephen White
On 2013/11/19 14:21:53, dshwang wrote: > On 2013/11/19 14:12:54, Stephen White wrote: > > On ...
7 years, 1 month ago (2013-11-19 14:34:57 UTC) #19
dshwang
On 2013/11/19 14:34:57, Stephen White wrote: > IIRC, it should be trying to create a ...
7 years, 1 month ago (2013-11-19 17:23:38 UTC) #20
Stephen White
LGTM
7 years, 1 month ago (2013-11-19 19:02:12 UTC) #21
dshwang
On 2013/11/19 19:02:12, Stephen White wrote: > LGTM thank you for review
7 years, 1 month ago (2013-11-19 19:12:03 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dongseong.hwang@intel.com/44253005/420001
7 years, 1 month ago (2013-11-19 19:12:22 UTC) #23
commit-bot: I haz the power
7 years, 1 month ago (2013-11-20 04:37:16 UTC) #24
Message was sent while issue was closed.
Change committed as 162330

Powered by Google App Engine
This is Rietveld 408576698