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

Issue 2803583003: ui: Remove use of bitmaps when painting tab backgrounds. (Closed)

Created:
3 years, 8 months ago by danakj
Modified:
3 years, 8 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, tfarina, miu+watch_chromium.org, enne (OOO), piman
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

ui: Remove use of bitmaps when painting tab backgrounds. This removes the use of gfx::Canvas::ExtractImageRep() which was being used for inactive tab backgrounds, to generate two bitmaps and draw them into the recording canvas when a clip on the second one. Instead, we just record the commands all directly to the recording canvas, and insert a save+clip+restore around the commands that were going into the second bitmap previously. Because we're no longer using bitmaps, this alleviates the need for caching and we remove the global tab background-bitmap cache. Also we collapse all cases in Tab::PaintInactiveTabBackground down to a single code path with some variables to control the output. The only change in behaviour due to collapsing code is that when TabController::MaySetClip() is true we always apply the clip for inactive tabs, whereas before the clip ould be ignored when a hover effect or custom fill image was present. This is more correct as described by pkasting in the CL review comments. R=pkasting@chromium.org BUG=671433 Review-Url: https://codereview.chromium.org/2803583003 Cr-Commit-Position: refs/heads/master@{#465266} Committed: https://chromium.googlesource.com/chromium/src/+/87648f2cf83870acac8d73ea6bb61a5dcf11b921

Patch Set 1 #

Patch Set 2 : tabbackground: . #

Total comments: 2

Patch Set 3 : tabbackground: return #

Patch Set 4 : tabbackground: pointers #

Total comments: 20

Patch Set 5 : tabbackground: pkasting-nits #

Patch Set 6 : tabbackground: cache-paths #

Total comments: 11

Patch Set 7 : tabbackground: with-cache #

Patch Set 8 : tabbackground: with-cache #

Total comments: 23

Patch Set 9 : tabbackground: fix-cache-bug-write-to-correct-canvas #

Patch Set 10 : tabbackground: review-feedback #

Patch Set 11 : tabbackground: no-path-cache #

Patch Set 12 : tabbackground: abovecomment #

Patch Set 13 : tabbackground: whitespacenit #

Patch Set 14 : tabbackground: rip-DCHECK_IMPLIES #

Total comments: 12

Patch Set 15 : tabbackground: rebase #

Patch Set 16 : tabbackground: nits #

Patch Set 17 : tabbackground: . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -212 lines) Patch
M chrome/browser/ui/views/tabs/tab.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +65 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +149 lines, -207 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 89 (60 generated)
danakj
3 years, 8 months ago (2017-04-05 20:46:51 UTC) #7
danakj
https://codereview.chromium.org/2803583003/diff/60001/ui/gfx/scoped_canvas.h File ui/gfx/scoped_canvas.h (right): https://codereview.chromium.org/2803583003/diff/60001/ui/gfx/scoped_canvas.h#newcode34 ui/gfx/scoped_canvas.h:34: o.canvas_ = nullptr; Oops, was missing the return here ...
3 years, 8 months ago (2017-04-05 22:01:37 UTC) #17
danakj
https://codereview.chromium.org/2803583003/diff/60001/ui/gfx/scoped_canvas.h File ui/gfx/scoped_canvas.h (right): https://codereview.chromium.org/2803583003/diff/60001/ui/gfx/scoped_canvas.h#newcode34 ui/gfx/scoped_canvas.h:34: o.canvas_ = nullptr; On 2017/04/05 22:01:37, danakj wrote: > ...
3 years, 8 months ago (2017-04-05 22:07:01 UTC) #20
sky
On 2017/04/05 22:07:01, danakj wrote: > https://codereview.chromium.org/2803583003/diff/60001/ui/gfx/scoped_canvas.h > File ui/gfx/scoped_canvas.h (right): > > https://codereview.chromium.org/2803583003/diff/60001/ui/gfx/scoped_canvas.h#newcode34 > ...
3 years, 8 months ago (2017-04-05 23:43:18 UTC) #24
Peter Kasting
Yeah, I share Scott's concerns. This is sort of like how the code worked long, ...
3 years, 8 months ago (2017-04-06 00:52:11 UTC) #25
danakj
> Have you done any performance analysis of this? Way back when the caching made ...
3 years, 8 months ago (2017-04-06 17:05:28 UTC) #31
danakj
Here's some numbers with the current patch. I'll cache the recording and see how that ...
3 years, 8 months ago (2017-04-06 17:22:16 UTC) #33
danakj
On Thu, Apr 6, 2017 at 1:22 PM, <danakj@chromium.org> wrote: > Here's some numbers with ...
3 years, 8 months ago (2017-04-06 17:26:46 UTC) #34
Peter Kasting
Reading your speed testing methodology, it looks like this will log the current average time ...
3 years, 8 months ago (2017-04-06 18:49:45 UTC) #35
danakj
On 2017/04/06 18:49:45, Peter Kasting wrote: > Reading your speed testing methodology, it looks like ...
3 years, 8 months ago (2017-04-06 19:13:27 UTC) #36
Peter Kasting
On 2017/04/06 19:13:27, danakj wrote: > On 2017/04/06 18:49:45, Peter Kasting wrote: > > Reading ...
3 years, 8 months ago (2017-04-06 19:20:57 UTC) #37
danakj
> The sizes of the inactive tabs are not all the same unless the tabstrip ...
3 years, 8 months ago (2017-04-06 20:08:52 UTC) #40
Peter Kasting
On Thu, Apr 6, 2017 at 1:08 PM, <danakj@chromium.org> wrote: > Hm, ok so AFAICT ...
3 years, 8 months ago (2017-04-06 20:20:35 UTC) #41
danakj
With non-ASAN release build now.. Here's non-themed case: 0.00249 ms per PaintInactiveTabBackground (after - cache ...
3 years, 8 months ago (2017-04-06 20:31:37 UTC) #42
danakj
On 2017/04/06 20:31:37, danakj wrote: > With non-ASAN release build now.. Here's non-themed case: > ...
3 years, 8 months ago (2017-04-06 20:35:03 UTC) #43
danakj
On 2017/04/06 20:35:03, danakj wrote: > On 2017/04/06 20:31:37, danakj wrote: > > With non-ASAN ...
3 years, 8 months ago (2017-04-06 20:39:17 UTC) #44
Peter Kasting
Thanks a ton for those performance numbers. They seem good enough to me to move ...
3 years, 8 months ago (2017-04-06 20:40:02 UTC) #45
danakj
Here's the rolling average I did for future reference as well, in case you want ...
3 years, 8 months ago (2017-04-06 20:41:38 UTC) #46
danakj
On 2017/04/06 20:40:02, Peter Kasting wrote: > Thanks a ton for those performance numbers. They ...
3 years, 8 months ago (2017-04-06 20:44:00 UTC) #48
Peter Kasting
https://codereview.chromium.org/2803583003/diff/180001/chrome/browser/ui/views/tabs/tab.cc File chrome/browser/ui/views/tabs/tab.cc (right): https://codereview.chromium.org/2803583003/diff/180001/chrome/browser/ui/views/tabs/tab.cc#newcode1120 chrome/browser/ui/views/tabs/tab.cc:1120: DCHECK(!y_offset || !fill_id); Nit: I'm not sure why this ...
3 years, 8 months ago (2017-04-07 00:59:20 UTC) #54
danakj
https://codereview.chromium.org/2803583003/diff/100001/chrome/browser/ui/views/tabs/tab.cc File chrome/browser/ui/views/tabs/tab.cc (right): https://codereview.chromium.org/2803583003/diff/100001/chrome/browser/ui/views/tabs/tab.cc#newcode1034 chrome/browser/ui/views/tabs/tab.cc:1034: const int kActiveTabFillId = btw while we're pointing at ...
3 years, 8 months ago (2017-04-07 19:10:50 UTC) #62
danakj
I tried templating the FillPathCache code into a PathCache, and made use of it for ...
3 years, 8 months ago (2017-04-07 19:44:01 UTC) #64
danakj
https://codereview.chromium.org/2803583003/diff/180001/chrome/browser/ui/views/tabs/tab.cc File chrome/browser/ui/views/tabs/tab.cc (right): https://codereview.chromium.org/2803583003/diff/180001/chrome/browser/ui/views/tabs/tab.cc#newcode1120 chrome/browser/ui/views/tabs/tab.cc:1120: DCHECK(!y_offset || !fill_id); On 2017/04/07 19:10:49, danakj wrote: > ...
3 years, 8 months ago (2017-04-07 21:31:08 UTC) #73
Peter Kasting
Have not re-reviewed https://codereview.chromium.org/2803583003/diff/100001/chrome/browser/ui/views/tabs/tab.cc File chrome/browser/ui/views/tabs/tab.cc (right): https://codereview.chromium.org/2803583003/diff/100001/chrome/browser/ui/views/tabs/tab.cc#newcode1086 chrome/browser/ui/views/tabs/tab.cc:1086: may_clip ? &clip : nullptr); On ...
3 years, 8 months ago (2017-04-07 23:34:03 UTC) #78
Peter Kasting
(You still have standing approval) https://codereview.chromium.org/2803583003/diff/180001/chrome/browser/ui/views/tabs/tab.cc File chrome/browser/ui/views/tabs/tab.cc (right): https://codereview.chromium.org/2803583003/diff/180001/chrome/browser/ui/views/tabs/tab.cc#newcode1140 chrome/browser/ui/views/tabs/tab.cc:1140: canvas->sk_canvas()->clipPath(*clip, SkClipOp::kDifference, true); On ...
3 years, 8 months ago (2017-04-08 00:59:38 UTC) #79
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/2803583003/340001
3 years, 8 months ago (2017-04-18 15:51:06 UTC) #82
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/2803583003/360001
3 years, 8 months ago (2017-04-18 15:52:51 UTC) #85
danakj
https://codereview.chromium.org/2803583003/diff/140001/chrome/browser/ui/views/tabs/tab.cc File chrome/browser/ui/views/tabs/tab.cc (right): https://codereview.chromium.org/2803583003/diff/140001/chrome/browser/ui/views/tabs/tab.cc#newcode153 chrome/browser/ui/views/tabs/tab.cc:153: cache.splice(cache.begin(), std::move(hit)); On 2017/04/07 23:34:02, Peter Kasting wrote: > ...
3 years, 8 months ago (2017-04-18 16:02:43 UTC) #86
commit-bot: I haz the power
3 years, 8 months ago (2017-04-18 16:41:45 UTC) #89
Message was sent while issue was closed.
Committed patchset #17 (id:360001) as
https://chromium.googlesource.com/chromium/src/+/87648f2cf83870acac8d73ea6bb6...

Powered by Google App Engine
This is Rietveld 408576698