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

Issue 2770943004: cros: Fix browser header wrongly drawn frame image (Closed)

Created:
3 years, 9 months ago by Qiang(Joe) Xu
Modified:
3 years, 8 months ago
Reviewers:
danakj, Peter Kasting
CC:
chromium-reviews, tfarina
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

cros: Fix browser header wrongly drawn frame image Changes: Check the code before https://codereview.chromium.org/2770943002, found that when frame_overlay_image_.isNull(), TileImageInt should be called. BUG=704636 TEST=test that bug doesn't happen with theme installed Review-Url: https://codereview.chromium.org/2770943004 Cr-Commit-Position: refs/heads/master@{#460265} Committed: https://chromium.googlesource.com/chromium/src/+/b30c149bc6b38870ca74cb8dcd5fb34e90e75480

Patch Set 1 #

Total comments: 2

Patch Set 2 : keep the middle branch and changed to Tile #

Total comments: 7

Patch Set 3 : based on suggestions #

Total comments: 4

Patch Set 4 : cleanup #

Patch Set 5 : default parameter #

Total comments: 4

Patch Set 6 : feedback #

Total comments: 3

Patch Set 7 : rebase #

Patch Set 8 : do not eliminate the last TileImageInt #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -10 lines) Patch
M chrome/browser/ui/views/frame/browser_header_painter_ash.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M ui/gfx/canvas.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M ui/gfx/canvas.cc View 1 2 3 4 5 6 7 4 chunks +11 lines, -7 lines 0 comments Download

Messages

Total messages: 64 (27 generated)
Qiang(Joe) Xu
Hi all, PTAL, thanks!
3 years, 9 months ago (2017-03-23 23:33:27 UTC) #6
Peter Kasting
LGTM. The key here is that DrawImageInPath(), which was used before, looks like a "draw" ...
3 years, 9 months ago (2017-03-23 23:51:22 UTC) #9
danakj
On 2017/03/23 23:51:22, Peter Kasting wrote: > LGTM. The key here is that DrawImageInPath(), which ...
3 years, 9 months ago (2017-03-24 14:59:50 UTC) #10
danakj
https://codereview.chromium.org/2770943004/diff/1/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/1/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->SaveLayerWithFlags(flags); SaveLayer isn't free, we should keep the middle ...
3 years, 9 months ago (2017-03-24 14:59:54 UTC) #11
Qiang(Joe) Xu
Hi all, please recheck the new patch. About the test coverage, we can file a ...
3 years, 9 months ago (2017-03-24 16:22:05 UTC) #13
danakj
https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), pkasting should confirm ...
3 years, 9 months ago (2017-03-24 16:29:31 UTC) #14
Peter Kasting
https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), On 2017/03/24 16:29:30, ...
3 years, 9 months ago (2017-03-24 20:08:13 UTC) #15
danakj
https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), On 2017/03/24 20:08:12, ...
3 years, 9 months ago (2017-03-24 20:22:52 UTC) #16
Peter Kasting
https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), On 2017/03/24 20:22:52, ...
3 years, 9 months ago (2017-03-24 20:26:38 UTC) #17
danakj
https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), On 2017/03/24 20:26:38, ...
3 years, 9 months ago (2017-03-24 20:33:55 UTC) #18
Peter Kasting
https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), On 2017/03/24 20:33:54, ...
3 years, 9 months ago (2017-03-24 20:39:40 UTC) #19
danakj
https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:84: canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), On 2017/03/24 20:39:40, ...
3 years, 9 months ago (2017-03-24 20:40:51 UTC) #20
Qiang(Joe) Xu
On 2017/03/24 20:40:51, danakj wrote: > https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc > File chrome/browser/ui/views/frame/browser_header_painter_ash.cc (right): > > https://codereview.chromium.org/2770943004/diff/20001/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode84 > ...
3 years, 9 months ago (2017-03-24 20:51:54 UTC) #21
Peter Kasting
On 2017/03/24 20:51:54, Qiang(Joe) Xu wrote: > hmm.. I am a little out reach of ...
3 years, 9 months ago (2017-03-24 20:55:42 UTC) #22
danakj
On Fri, Mar 24, 2017 at 4:51 PM, <warx@chromium.org> wrote: > On 2017/03/24 20:40:51, danakj ...
3 years, 9 months ago (2017-03-24 20:55:44 UTC) #23
Qiang(Joe) Xu
On 2017/03/24 20:55:44, danakj wrote: > On Fri, Mar 24, 2017 at 4:51 PM, <mailto:warx@chromium.org> ...
3 years, 9 months ago (2017-03-24 20:58:50 UTC) #24
Qiang(Joe) Xu
Hi all, PTAL, thanks! https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h File ui/gfx/canvas.h (right): https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h#newcode440 ui/gfx/canvas.h:440: void TileImageInt(const ImageSkia& image, I ...
3 years, 9 months ago (2017-03-24 21:55:33 UTC) #25
Peter Kasting
LGTM with an API cleanup suggestion https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h File ui/gfx/canvas.h (right): https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h#newcode440 ui/gfx/canvas.h:440: void TileImageInt(const ImageSkia& ...
3 years, 9 months ago (2017-03-24 22:09:11 UTC) #26
Qiang(Joe) Xu
On 2017/03/24 22:09:11, Peter Kasting wrote: > LGTM with an API cleanup suggestion > > ...
3 years, 9 months ago (2017-03-24 22:31:45 UTC) #28
Peter Kasting
Note: Please try to reply to comments using the per-comment reply interface, rather than "send ...
3 years, 9 months ago (2017-03-24 22:41:14 UTC) #29
Qiang(Joe) Xu
OK, thanks for the suggestion. Done. https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h File ui/gfx/canvas.h (right): https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h#newcode440 ui/gfx/canvas.h:440: void TileImageInt(const ImageSkia& ...
3 years, 9 months ago (2017-03-24 22:51:06 UTC) #30
Peter Kasting
https://codereview.chromium.org/2770943004/diff/100001/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): https://codereview.chromium.org/2770943004/diff/100001/ui/gfx/canvas.cc#newcode504 ui/gfx/canvas.cc:504: flags = &paint_flags; This doesn't work -- you've declared ...
3 years, 9 months ago (2017-03-24 22:52:35 UTC) #31
Qiang(Joe) Xu
https://codereview.chromium.org/2770943004/diff/100001/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): https://codereview.chromium.org/2770943004/diff/100001/ui/gfx/canvas.cc#newcode504 ui/gfx/canvas.cc:504: flags = &paint_flags; On 2017/03/24 22:52:35, Peter Kasting wrote: ...
3 years, 9 months ago (2017-03-24 22:57:00 UTC) #32
Peter Kasting
LGTM
3 years, 9 months ago (2017-03-24 22:58:01 UTC) #33
danakj
LGTM https://codereview.chromium.org/2770943004/diff/120001/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): https://codereview.chromium.org/2770943004/diff/120001/ui/gfx/canvas.cc#newcode514 ui/gfx/canvas.cc:514: float tile_scale_x, These tile_scales are never anything but ...
3 years, 8 months ago (2017-03-28 14:34:37 UTC) #34
Qiang(Joe) Xu
https://codereview.chromium.org/2770943004/diff/120001/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): https://codereview.chromium.org/2770943004/diff/120001/ui/gfx/canvas.cc#newcode514 ui/gfx/canvas.cc:514: float tile_scale_x, On 2017/03/28 14:34:37, danakj wrote: > These ...
3 years, 8 months ago (2017-03-28 17:11:15 UTC) #35
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/2770943004/120001
3 years, 8 months ago (2017-03-28 17:11:48 UTC) #37
danakj
https://codereview.chromium.org/2770943004/diff/120001/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): https://codereview.chromium.org/2770943004/diff/120001/ui/gfx/canvas.cc#newcode514 ui/gfx/canvas.cc:514: float tile_scale_x, On 2017/03/28 17:11:15, Qiang(Joe) Xu wrote: > ...
3 years, 8 months ago (2017-03-28 17:49:41 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/376510)
3 years, 8 months ago (2017-03-28 17:57:57 UTC) #40
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/2770943004/120001
3 years, 8 months ago (2017-03-28 19:56:06 UTC) #42
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/2770943004/140001
3 years, 8 months ago (2017-03-28 20:24:35 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/393311)
3 years, 8 months ago (2017-03-28 21:04:20 UTC) #47
Qiang(Joe) Xu
https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h File ui/gfx/canvas.h (right): https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h#newcode440 ui/gfx/canvas.h:440: void TileImageInt(const ImageSkia& image, On 2017/03/24 22:09:10, Peter Kasting ...
3 years, 8 months ago (2017-03-28 23:21:07 UTC) #56
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/2770943004/160001
3 years, 8 months ago (2017-03-29 00:37:40 UTC) #59
Peter Kasting
On 2017/03/28 23:21:07, Qiang(Joe) Xu wrote: > https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h > File ui/gfx/canvas.h (right): > > https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h#newcode440 ...
3 years, 8 months ago (2017-03-29 01:37:06 UTC) #60
commit-bot: I haz the power
Committed patchset #8 (id:160001) as https://chromium.googlesource.com/chromium/src/+/b30c149bc6b38870ca74cb8dcd5fb34e90e75480
3 years, 8 months ago (2017-03-29 03:22:59 UTC) #63
Qiang(Joe) Xu
3 years, 8 months ago (2017-03-29 16:41:10 UTC) #64
Message was sent while issue was closed.
On 2017/03/29 01:37:06, Peter Kasting wrote:
> On 2017/03/28 23:21:07, Qiang(Joe) Xu wrote:
> > https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h
> > File ui/gfx/canvas.h (right):
> > 
> >
>
https://codereview.chromium.org/2770943004/diff/40001/ui/gfx/canvas.h#newcode440
> > ui/gfx/canvas.h:440: void TileImageInt(const ImageSkia& image,
> > On 2017/03/24 22:09:10, Peter Kasting wrote:
> > > On 2017/03/24 21:55:33, Qiang(Joe) Xu wrote:
> > > > I still keep the no-flag version since there are some (but not many)
> callers
> > > of
> > > > it.
> > > 
> > > It looks like the three existing functions here have something like 19, 6,
> and
> > 1
> > > callers, respectively (per codesearch xrefs, which may be inaccurate, but
a
> > > glance through the text search results suggests this is close).  I suggest
> the
> > > following:
> > > 
> > > * Eliminate the very last function (that takes tile_scale_x/y) as it's
just
> > the
> > > internal implementation, and roll its functionality into the
second-to-last
> > > function
> > > * Rather than add a new copy here, just add the flags argument to the
> existing
> > > 7-arg function, with a default "= nullptr"
> > 
> > We shall not eliminate the last function because of:
> >
>
https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/glass_brow...,
> > it is compiled for OS_WIN. Do you want a recheck, pkasting@?
> 
> If that's the lone caller, then rather than readd this function, I'd just make
> the tile scale args be passed before the paint flags so they can be defaulted
as
> well.
> 
> This will also let you collapse the separate X and Y scales into a single
scale
> factor arg since it looks like the callers all want to pass the same scale for
> both.

I filed crbug.com/706441 to track this cleanup.

Powered by Google App Engine
This is Rietveld 408576698