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

Issue 2280723003: Avoid making the shared main thread context if we won't use it. (Closed)

Created:
4 years, 3 months ago by danakj
Modified:
4 years, 3 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, dshwang, ajuma+watch-canvas_chromium.org, blink-reviews-html_chromium.org, jam, Justin Novosad, dglazkov+blink, Rik, darin-cc_chromium.org, blink-reviews, piman+watch_chromium.org, enne (OOO), piman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid making the shared main thread context if we won't use it. When deciding if HTMLCanvasElement should be accelerated we changed the code to get the shared main thread context before making the decision because it's part of the decision. However, for most of the things we decide on (such as are-we-using-display-list-canvas) we don't care about the context. We only care once we decide we do want to use it, then verify it's not using swiftshader. So, defer getting/creating the shared main thread context until we know we want to accelerate, then just fail to accelerate if swiftshader. To make this logic more clear, I split the createImageBufferSurface() method into createAcceleratedImageBufferSurface() and createSoftwareImageBufferSurface() which is used if the former fails/returns null. There is less nesting now so hopefully that's nice. With this the memory.blink_memory_mobile's TheVerge case goes from 6422Kb of gpu memory back down to 4324Kb. R=junov@chromium.org, kbr@chromium.org BUG=640811, 606056 Committed: https://crrev.com/03fe53dc4730038b5d13613fcbad10fc9a204c54 Cr-Commit-Position: refs/heads/master@{#414806}

Patch Set 1 #

Patch Set 2 : regress: . #

Patch Set 3 : regress: . #

Patch Set 4 : regress: rebase #

Total comments: 3

Patch Set 5 : regress: name #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -37 lines) Patch
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 chunks +47 lines, -35 lines 0 comments Download

Messages

Total messages: 23 (16 generated)
danakj
4 years, 3 months ago (2016-08-25 23:18:39 UTC) #11
Ken Russell (switch to Gerrit)
Thanks for tracking this down Dana. It looks good to me, but Justin or someone ...
4 years, 3 months ago (2016-08-26 00:19:06 UTC) #12
Justin Novosad
lgtm with nit https://codereview.chromium.org/2280723003/diff/60001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/2280723003/diff/60001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp#newcode848 third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:848: if (contextProvider->isSoftwareRendering()) In a follow-up CL ...
4 years, 3 months ago (2016-08-26 14:11:13 UTC) #15
danakj
https://codereview.chromium.org/2280723003/diff/60001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h File third_party/WebKit/Source/core/html/HTMLCanvasElement.h (right): https://codereview.chromium.org/2280723003/diff/60001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h#newcode234 third_party/WebKit/Source/core/html/HTMLCanvasElement.h:234: std::unique_ptr<ImageBufferSurface> createSoftwareImageBufferSurface(const IntSize& deviceSize, OpacityMode, sk_sp<SkColorSpace>); On 2016/08/26 14:11:12, ...
4 years, 3 months ago (2016-08-26 18:28:48 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2280723003/80001
4 years, 3 months ago (2016-08-26 18:30:04 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-08-26 21:18:34 UTC) #21
commit-bot: I haz the power
4 years, 3 months ago (2016-08-26 21:20:08 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/03fe53dc4730038b5d13613fcbad10fc9a204c54
Cr-Commit-Position: refs/heads/master@{#414806}

Powered by Google App Engine
This is Rietveld 408576698