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

Issue 2694023003: Make CanvasPainter raster directly to an SkBitmap (Closed)

Created:
3 years, 10 months ago by enne (OOO)
Modified:
3 years, 10 months ago
Reviewers:
danakj, tapted
CC:
chromium-reviews, danakj+watch_chromium.org, dcheng, jbauman+watch_chromium.org, kalyank, mac-reviews_chromium.org, nona+watch_chromium.org, piman+watch_chromium.org, shuchen+watch_chromium.org, James Su, tfarina, Ian Vollick, yusukes+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make CanvasPainter raster directly to an SkBitmap This refactoring is removing a dependency where code wants to raster a DisplayItemList into a gfx::Canvas / cc::PaintCanvas. Currently, gfx::Canvas is backed by a cc::PaintCanvas instead of an SkCanvas. DisplayItemList can only raster into an SkCanvas and not into a cc::PaintCanvas interface. This works currently because PaintCanvas is-a SkCanvas (via a typedef), but will break once they become different concrete types. It doesn't seem desirable to make DisplayItemList and cc::PaintRecord to have duplicate Raster functions for both SkCanvas and PaintCanvas. Therefore, instead make ui::CanvasPainter raster directly from DisplayItemList into an SkBitmap without a gfx::Canvas or PaintCanvas intermediary. This means that CanvasPainter needs to grow a tiny bit of logic from both gfx::Canvas, but this is smaller than the alternative. BUG=671433 Review-Url: https://codereview.chromium.org/2694023003 Cr-Commit-Position: refs/heads/master@{#450594} Committed: https://chromium.googlesource.com/chromium/src/+/ed75029a4736960aef2fe37cefb1f7ccc8417d83

Patch Set 1 #

Patch Set 2 : Remove mac changes #

Patch Set 3 : Replace CanvasPainter rect with size #

Total comments: 8

Patch Set 4 : danakj review #

Total comments: 13

Patch Set 5 : tapted review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -50 lines) Patch
M ui/compositor/canvas_painter.h View 1 2 3 1 chunk +15 lines, -14 lines 0 comments Download
M ui/compositor/canvas_painter.cc View 1 2 3 1 chunk +21 lines, -10 lines 0 comments Download
M ui/views/button_drag_utils.cc View 1 2 3 4 1 chunk +10 lines, -8 lines 0 comments Download
M ui/views/cocoa/bridged_content_view.mm View 1 1 chunk +2 lines, -3 lines 0 comments Download
M ui/views/controls/label_unittest.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 2 3 4 1 chunk +10 lines, -5 lines 0 comments Download
M ui/views/drag_utils.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/drag_utils.cc View 1 2 3 4 2 chunks +4 lines, -8 lines 0 comments Download

Messages

Total messages: 29 (20 generated)
enne (OOO)
3 years, 10 months ago (2017-02-14 19:28:55 UTC) #5
enne (OOO)
I should add that I tested these changes manually with and without device scale on ...
3 years, 10 months ago (2017-02-14 19:52:47 UTC) #9
danakj
LGTM https://codereview.chromium.org/2694023003/diff/40001/ui/compositor/canvas_painter.h File ui/compositor/canvas_painter.h (right): https://codereview.chromium.org/2694023003/diff/40001/ui/compositor/canvas_painter.h#newcode29 ui/compositor/canvas_painter.h:29: CanvasPainter(SkBitmap* output, In blink at least this type ...
3 years, 10 months ago (2017-02-14 21:37:26 UTC) #12
enne (OOO)
Done, thanks! :)
3 years, 10 months ago (2017-02-14 22:03:52 UTC) #14
tapted
I think GetDeviceScaleForNativeView(..) needs a different name, otherwise just nits https://codereview.chromium.org/2694023003/diff/60001/ui/views/button_drag_utils.cc File ui/views/button_drag_utils.cc (right): https://codereview.chromium.org/2694023003/diff/60001/ui/views/button_drag_utils.cc#newcode86 ...
3 years, 10 months ago (2017-02-14 23:34:08 UTC) #18
enne (OOO)
Done, thanks! I should also mention that this patch fixes the scale of icons being ...
3 years, 10 months ago (2017-02-15 00:02:05 UTC) #19
tapted
ui/views lgtm - thanks! https://codereview.chromium.org/2694023003/diff/60001/ui/views/drag_utils.cc File ui/views/drag_utils.cc (right): https://codereview.chromium.org/2694023003/diff/60001/ui/views/drag_utils.cc#newcode15 ui/views/drag_utils.cc:15: float GetDeviceScaleForNativeView(views::Widget* widget) { On ...
3 years, 10 months ago (2017-02-15 00:41:24 UTC) #22
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/2694023003/80001
3 years, 10 months ago (2017-02-15 01:10:27 UTC) #26
commit-bot: I haz the power
3 years, 10 months ago (2017-02-15 06:30:20 UTC) #29
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/ed75029a4736960aef2fe37cefb1...

Powered by Google App Engine
This is Rietveld 408576698