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

Issue 2770943002: Remove ExtractImageRep from the browser frame header painting code. (Closed)

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

Description

Remove ExtractImageRep from the browser frame header painting code. PaintFrameImagesInRoundRect() would use an intermediate bitmap to images into, then draw that bitmap with a clip and blendmode back into the original canvas. We can do this instead with SaveLayer. This adds a SaveLayer variant that takes an arbitrary PaintFlags, to allow this use case, and uses that instead of generating an extra bitmap on the CPU. While here, we improve the readability of this code some by removing an always-false if condition (isSrcOver) and moving code closer so that we prove it is always false and stays that way. R=bsep@chromium.org, pkasting@chromium.org BUG=671433 Review-Url: https://codereview.chromium.org/2770943002 Cr-Commit-Position: refs/heads/master@{#458929} Committed: https://chromium.googlesource.com/chromium/src/+/226e88f271fb6fc8a47110d440c9e12662edec95

Patch Set 1 #

Total comments: 2

Patch Set 2 : header-bitmap: scopedcanvas #

Patch Set 3 : header-bitmap: headers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -46 lines) Patch
M chrome/browser/ui/views/frame/browser_header_painter_ash.cc View 1 2 4 chunks +34 lines, -46 lines 0 comments Download
M ui/gfx/canvas.h View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gfx/canvas.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (11 generated)
danakj
Because I don't think there's any pixel tests here's a series of images of what ...
3 years, 9 months ago (2017-03-22 22:14:01 UTC) #3
danakj
On 2017/03/22 22:14:01, danakj wrote: > Because I don't think there's any pixel tests here's ...
3 years, 9 months ago (2017-03-22 22:16:12 UTC) #4
Peter Kasting
LGTM! https://codereview.chromium.org/2770943002/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/2770943002/diff/1/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode71 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:71: canvas->Save(); Nit: Prefer ScopedCanvas to explicit Save()/Restore() pairing
3 years, 9 months ago (2017-03-22 22:25:57 UTC) #5
danakj
https://codereview.chromium.org/2770943002/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/2770943002/diff/1/chrome/browser/ui/views/frame/browser_header_painter_ash.cc#newcode71 chrome/browser/ui/views/frame/browser_header_painter_ash.cc:71: canvas->Save(); On 2017/03/22 22:25:57, Peter Kasting wrote: > Nit: ...
3 years, 9 months ago (2017-03-22 22:27:47 UTC) #8
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/2770943002/20001
3 years, 9 months ago (2017-03-22 22:28:30 UTC) #9
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/2770943002/40001
3 years, 9 months ago (2017-03-22 22:29:10 UTC) #12
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/2770943002/60001
3 years, 9 months ago (2017-03-22 22:29:49 UTC) #16
Bret
lgtm as well
3 years, 9 months ago (2017-03-22 22:32:13 UTC) #17
commit-bot: I haz the power
3 years, 9 months ago (2017-03-22 23:28:34 UTC) #20
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/226e88f271fb6fc8a47110d440c9...

Powered by Google App Engine
This is Rietveld 408576698