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

Issue 210043004: Draw thin slices of an image w/ anti-aliasing for 2D <canvas> (Closed)

Created:
6 years, 9 months ago by fs
Modified:
6 years, 8 months ago
CC:
blink-reviews, jamesr, krit, dsinclair, jbroman, danakj, pdr., rwlbuis
Visibility:
Public.

Description

Draw thin slices of an image w/ anti-aliasing for 2D <canvas> Add a GraphicsContext-scoped flag that allows anti-aliasing of (all) image-geometry to be enabled in a selective manner. Enable this behavior for CanvasRenderingContext2D. When this flag is set, image geometry that would drawn as very thin (< 1 device pixel wide/high) will be anti-aliased. BUG=352611 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170671

Patch Set 1 #

Patch Set 2 : Add fabs(). #

Patch Set 3 : TC. #

Total comments: 3

Patch Set 4 : Revised solution; Add simple perftest. #

Patch Set 5 : Update TestExpectations. #

Patch Set 6 : Rebase. #

Patch Set 7 : Combined solution. #

Total comments: 2

Patch Set 8 : Add 'hairline' to names. #

Patch Set 9 : Rebase; Rename some more. #

Total comments: 2

Patch Set 10 : Clarifications. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -5 lines) Patch
A LayoutTests/canvas/thin-drawImages.html View 1 2 3 1 chunk +54 lines, -0 lines 0 comments Download
A LayoutTests/canvas/thin-drawImages-expected.txt View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
A + PerformanceTests/Canvas/drawimage-not-pixelaligned.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.h View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -0 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/graphics/skia/NativeImageSkia.cpp View 1 2 3 4 5 6 7 8 2 chunks +27 lines, -4 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
fs
I'd hoped to get a discussion going, but it seemed that didn't even trigger a ...
6 years, 9 months ago (2014-03-25 14:07:38 UTC) #1
reed1
Querying the CTM at "draw" time inside blink is not reliable. It may not predict ...
6 years, 9 months ago (2014-03-25 14:24:55 UTC) #2
Justin Novosad
I totally agree with this change. lgtm with nits. https://codereview.chromium.org/210043004/diff/60001/LayoutTests/canvas/thin-drawImages.html File LayoutTests/canvas/thin-drawImages.html (right): https://codereview.chromium.org/210043004/diff/60001/LayoutTests/canvas/thin-drawImages.html#newcode8 LayoutTests/canvas/thin-drawImages.html:8: ...
6 years, 9 months ago (2014-03-25 14:35:06 UTC) #3
Justin Novosad
Oh yeah, not lgtm because of what mike said. We need to do this on ...
6 years, 9 months ago (2014-03-25 14:36:06 UTC) #4
Stephen Chennney
On 2014/03/25 14:24:55, reed1 wrote: > Querying the CTM at "draw" time inside blink is ...
6 years, 9 months ago (2014-03-25 14:37:30 UTC) #5
Justin Novosad
My understanding is that this is a 2D canvas only bug because in regular HTML, ...
6 years, 9 months ago (2014-03-25 14:42:10 UTC) #6
fs
On 2014/03/25 14:24:55, reed1 wrote: > Querying the CTM at "draw" time inside blink is ...
6 years, 9 months ago (2014-03-25 14:56:49 UTC) #7
Justin Novosad
FWIW, I think we should avoid enabling anti-aliasing globally. I am concerned that this could ...
6 years, 9 months ago (2014-03-25 15:07:49 UTC) #8
fs
On 2014/03/25 14:42:10, junov wrote: > My understanding is that this is a 2D canvas ...
6 years, 9 months ago (2014-03-25 15:11:10 UTC) #9
f(malita)
On 2014/03/25 14:56:49, fs wrote: > On 2014/03/25 14:24:55, reed1 wrote: > > Querying the ...
6 years, 9 months ago (2014-03-25 15:39:17 UTC) #10
Justin Novosad
On 2014/03/25 15:39:17, Florin Malita wrote: > FWIW, I think in practice we only tweak ...
6 years, 9 months ago (2014-03-25 15:52:07 UTC) #11
fs
On 2014/03/25 15:11:10, fs wrote: > On 2014/03/25 14:42:10, junov wrote: > > My understanding ...
6 years, 9 months ago (2014-03-25 16:06:39 UTC) #12
reed1
1. antialiasing only has a cost on the edges. it does not scale up with ...
6 years, 9 months ago (2014-03-25 16:14:12 UTC) #13
Justin Novosad
On 2014/03/25 16:14:12, reed1 wrote: > 1. antialiasing only has a cost on the edges. ...
6 years, 9 months ago (2014-03-25 16:51:23 UTC) #14
fs
On 2014/03/25 16:14:12, reed1 wrote: > 2. if we are worried about seaming (which sometimes ...
6 years, 9 months ago (2014-03-25 16:54:09 UTC) #15
fs
Thanks for the feedback so far. Uploaded a new patchset w/ the GC-global enabling flag. ...
6 years, 9 months ago (2014-03-25 17:18:50 UTC) #16
Rik
On 2014/03/25 14:07:38, fs wrote: > I'd hoped to get a discussion going, but it ...
6 years, 9 months ago (2014-03-26 00:18:25 UTC) #17
fs
On 2014/03/26 00:18:25, Rik wrote: > On 2014/03/25 14:07:38, fs wrote: > > I'd hoped ...
6 years, 9 months ago (2014-03-26 08:26:12 UTC) #18
fs
On 2014/03/25 17:18:50, fs wrote: > Thanks for the feedback so far. Uploaded a new ...
6 years, 9 months ago (2014-03-27 16:29:40 UTC) #19
fs
Uploaded a version which combines the "thin slice" detection with a flag to allow only ...
6 years, 9 months ago (2014-03-28 16:00:37 UTC) #20
Justin Novosad
https://codereview.chromium.org/210043004/diff/440001/Source/platform/graphics/GraphicsContext.h File Source/platform/graphics/GraphicsContext.h (right): https://codereview.chromium.org/210043004/diff/440001/Source/platform/graphics/GraphicsContext.h#newcode143 Source/platform/graphics/GraphicsContext.h:143: bool shouldAntialiasImages() const { return m_antialiasImages && shouldAntialias(); } ...
6 years, 9 months ago (2014-03-28 18:20:38 UTC) #21
fs
https://codereview.chromium.org/210043004/diff/440001/Source/platform/graphics/GraphicsContext.h File Source/platform/graphics/GraphicsContext.h (right): https://codereview.chromium.org/210043004/diff/440001/Source/platform/graphics/GraphicsContext.h#newcode143 Source/platform/graphics/GraphicsContext.h:143: bool shouldAntialiasImages() const { return m_antialiasImages && shouldAntialias(); } ...
6 years, 8 months ago (2014-03-31 08:21:11 UTC) #22
Justin Novosad
On 2014/03/31 08:21:11, fs wrote: > https://codereview.chromium.org/210043004/diff/440001/Source/platform/graphics/GraphicsContext.h > File Source/platform/graphics/GraphicsContext.h (right): > > https://codereview.chromium.org/210043004/diff/440001/Source/platform/graphics/GraphicsContext.h#newcode143 > ...
6 years, 8 months ago (2014-03-31 15:14:45 UTC) #23
fs
On 2014/03/31 15:14:45, junov wrote: > On 2014/03/31 08:21:11, fs wrote: > > > https://codereview.chromium.org/210043004/diff/440001/Source/platform/graphics/GraphicsContext.h ...
6 years, 8 months ago (2014-03-31 15:30:20 UTC) #24
fs
On 2014/03/31 15:30:20, fs wrote: > On 2014/03/31 15:14:45, junov wrote: > > On 2014/03/31 ...
6 years, 8 months ago (2014-03-31 16:14:00 UTC) #25
fs
Ping?
6 years, 8 months ago (2014-04-01 16:43:00 UTC) #26
Justin Novosad
https://codereview.chromium.org/210043004/diff/480001/Source/platform/graphics/GraphicsContext.h File Source/platform/graphics/GraphicsContext.h (right): https://codereview.chromium.org/210043004/diff/480001/Source/platform/graphics/GraphicsContext.h#newcode139 Source/platform/graphics/GraphicsContext.h:139: // Disable the optimization that disables anti-aliasing for Double ...
6 years, 8 months ago (2014-04-01 17:02:01 UTC) #27
fs
https://codereview.chromium.org/210043004/diff/480001/Source/platform/graphics/GraphicsContext.h File Source/platform/graphics/GraphicsContext.h (right): https://codereview.chromium.org/210043004/diff/480001/Source/platform/graphics/GraphicsContext.h#newcode139 Source/platform/graphics/GraphicsContext.h:139: // Disable the optimization that disables anti-aliasing for On ...
6 years, 8 months ago (2014-04-02 08:31:37 UTC) #28
Justin Novosad
On 2014/04/02 08:31:37, fs wrote: > https://codereview.chromium.org/210043004/diff/480001/Source/platform/graphics/GraphicsContext.h > File Source/platform/graphics/GraphicsContext.h (right): > > https://codereview.chromium.org/210043004/diff/480001/Source/platform/graphics/GraphicsContext.h#newcode139 > ...
6 years, 8 months ago (2014-04-02 14:57:13 UTC) #29
fs
The CQ bit was checked by fs@opera.com
6 years, 8 months ago (2014-04-02 15:56:34 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/210043004/500001
6 years, 8 months ago (2014-04-02 15:56:42 UTC) #31
commit-bot: I haz the power
6 years, 8 months ago (2014-04-02 17:06:45 UTC) #32
Message was sent while issue was closed.
Change committed as 170671

Powered by Google App Engine
This is Rietveld 408576698