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

Issue 1482363004: Fixing laggy chrome on a multitude of accelerated canvases (Closed)

Created:
5 years ago by xlai (Olivia)
Modified:
5 years ago
Reviewers:
danakj, Justin Novosad
CC:
chromium-reviews, dshwang, ajuma+watch-canvas_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink, Rik, blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixing laggy chrome on a multitude of accelerated canvases This CL adds a static variable in ImageBuffer that keeps track of global GPU memory usage, as well as a member variable for GPU memory usage in current ImageBuffer. These are useful metrics for accelerated canvases. By doing local experiments on Linux desktops and Android One, I put a conservative estimate on the maximum limit that this static variable can take before the UI responses on chrome becomes laggy. The estimate is equivalent to the allocated memory for 80 accelerated 2d canvases with 1000*500 size; the estimate for Android is a quarter of that. The GPU memory usage should be updated when ImageBuffer is created, destroyed or switching from accelerated mode to non- accelerated mode or vice versa. Unit Test CanvasRendering- Context2DTest.GPUMemoryUpdateForAcceleratedCanvas added. BUG=548209 Committed: https://crrev.com/03e80a23c15918259bafc6e67c77e7059e377391 Cr-Commit-Position: refs/heads/master@{#364487}

Patch Set 1 #

Total comments: 14

Patch Set 2 : Changes based on feedbacks from danakj #

Total comments: 6

Patch Set 3 : Changes to naming/computation according to feedback #

Patch Set 4 : Moving variables to ImageBuffer and Adding Unit Test #

Total comments: 12

Patch Set 5 : Renamed "total" to "global"; changing positions that call updateGPUMemory function; added tests abo… #

Patch Set 6 : Rebase and Fixing Presubmit warnings #

Patch Set 7 : m_imageBuffer nullibility check to ensure other unrelated unit tests on layerbridge not fail #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -1 line) Patch
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 2 chunks +24 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp View 1 2 3 4 5 3 chunks +61 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.h View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 6 2 chunks +27 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (15 generated)
xlai (Olivia)
junov@: the original updateExternallyAllocatedMemory computes usage for both un-accelerated and accelerated canvases. I separated the ...
5 years ago (2015-11-30 22:49:14 UTC) #2
danakj
https://codereview.chromium.org/1482363004/diff/1/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/1482363004/diff/1/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp#newcode83 third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:83: // Max Limit of Externally Allocated Memory comments are ...
5 years ago (2015-11-30 23:07:03 UTC) #3
xlai (Olivia)
Fixed codes/comments/styles based on previous feedbacks. There are a few parts that I didn't change ...
5 years ago (2015-12-01 21:50:25 UTC) #4
danakj
https://codereview.chromium.org/1482363004/diff/1/third_party/WebKit/Source/core/html/HTMLCanvasElement.h File third_party/WebKit/Source/core/html/HTMLCanvasElement.h (right): https://codereview.chromium.org/1482363004/diff/1/third_party/WebKit/Source/core/html/HTMLCanvasElement.h#newcode213 third_party/WebKit/Source/core/html/HTMLCanvasElement.h:213: static intptr_t s_totalMemoryForAcceleratedCanvases; On 2015/12/01 21:50:25, Olivia wrote: > ...
5 years ago (2015-12-01 22:13:35 UTC) #5
Justin Novosad
https://codereview.chromium.org/1482363004/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/1482363004/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp#newcode72 third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:72: const int kDefaultWidth = 300; The k prefix is ...
5 years ago (2015-12-02 16:33:34 UTC) #6
Justin Novosad
@danakj: Why do think the threshold tracking should be a tab-local or page-local thing? GPU ...
5 years ago (2015-12-02 17:18:35 UTC) #7
danakj
> @danakj: Why do think the threshold tracking should be a tab-local or page-local > ...
5 years ago (2015-12-02 18:23:40 UTC) #8
danakj
https://codereview.chromium.org/1482363004/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/1482363004/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp#newcode72 third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:72: const int kDefaultWidth = 300; On 2015/12/02 18:23:40, danakj ...
5 years ago (2015-12-02 18:31:09 UTC) #9
Justin Novosad
On 2015/12/02 18:23:40, danakj (behind on reviews) wrote: > > @danakj: Why do think the ...
5 years ago (2015-12-02 18:41:16 UTC) #10
xlai (Olivia)
Basic changes: 1)rename updateExternallyAllocatedMemory to updateMemoryUsage() so that it encompasses both non-GPU and GPU memory ...
5 years ago (2015-12-07 16:53:58 UTC) #12
Justin Novosad
https://codereview.chromium.org/1482363004/diff/80001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (left): https://codereview.chromium.org/1482363004/diff/80001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp#oldcode765 third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:765: // Four bytes per pixel per buffer. Why remove ...
5 years ago (2015-12-08 22:15:27 UTC) #13
xlai (Olivia)
A new patchset that makes the following changes: Renamed "total" to "global"; Change "FakeAcceleratedImageBufferSurfaceForTesting" class; ...
5 years ago (2015-12-09 00:38:16 UTC) #14
Justin Novosad
lgtm This other WIP CL deals with coordinating GPU resource management with page visibility https://codereview.chromium.org/1507863005/
5 years ago (2015-12-09 18:35:39 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1482363004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1482363004/100001
5 years ago (2015-12-09 19:09:21 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/127136)
5 years ago (2015-12-09 19:19:55 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1482363004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1482363004/120001
5 years ago (2015-12-09 19:30:22 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1482363004/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1482363004/140001
5 years ago (2015-12-10 20:39:13 UTC) #30
commit-bot: I haz the power
Committed patchset #7 (id:140001)
5 years ago (2015-12-10 21:49:45 UTC) #32
commit-bot: I haz the power
5 years ago (2015-12-10 21:50:40 UTC) #34
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/03e80a23c15918259bafc6e67c77e7059e377391
Cr-Commit-Position: refs/heads/master@{#364487}

Powered by Google App Engine
This is Rietveld 408576698