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

Issue 2157953002: Change filter quality when scaling-down in drawImage (Closed)

Created:
4 years, 5 months ago by xidachen
Modified:
4 years, 5 months ago
Reviewers:
Justin Novosad
CC:
chromium-reviews, blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change filter quality when scaling-down in drawImage When calling drawImage with imageSmoothingEnabled = false, we use nearest neighbor as the filter. In the spec, it doesn't specify that we need to use nearest neighbor when scaling down, so this CL changes to use kLow_FitlerQuality when scaling down. BUG=269089 Committed: https://crrev.com/6ea454313e099cb68ea91d31ef8f2f54ac4c393c Cr-Commit-Position: refs/heads/master@{#406824}

Patch Set 1 #

Total comments: 3

Patch Set 2 : no need to change Image::draw API #

Total comments: 3

Patch Set 3 : account for transformation, layout test added #

Patch Set 4 : change expected.txt #

Total comments: 2

Patch Set 5 : account for rotation and update layout test #

Total comments: 2

Patch Set 6 : address comments #

Patch Set 7 : update test expectation #

Messages

Total messages: 33 (15 generated)
xidachen
PTAL
4 years, 5 months ago (2016-07-18 15:30:26 UTC) #3
Justin Novosad
On 2016/07/18 15:30:26, xidachen wrote: > PTAL The crbug and and the spec change referenced ...
4 years, 5 months ago (2016-07-18 15:37:03 UTC) #4
f(malita)
https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/platform/graphics/Image.h File third_party/WebKit/Source/platform/graphics/Image.h (right): https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/platform/graphics/Image.h#newcode153 third_party/WebKit/Source/platform/graphics/Image.h:153: virtual void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const ...
4 years, 5 months ago (2016-07-18 15:46:38 UTC) #5
fs
https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode261 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:261: adjustedPaint.setFilterQuality(kLow_SkFilterQuality); This should not have any effect. Ditto below, ...
4 years, 5 months ago (2016-07-18 15:56:55 UTC) #6
xidachen
On 2016/07/18 15:46:38, f(malita) wrote: > https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/platform/graphics/Image.h > File third_party/WebKit/Source/platform/graphics/Image.h (right): > > https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/platform/graphics/Image.h#newcode153 > ...
4 years, 5 months ago (2016-07-18 15:57:00 UTC) #7
Justin Novosad
On 2016/07/18 15:57:00, xidachen wrote: > On 2016/07/18 15:46:38, f(malita) wrote: > > > https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/platform/graphics/Image.h ...
4 years, 5 months ago (2016-07-18 17:33:37 UTC) #8
Justin Novosad
On 2016/07/18 15:56:55, fs wrote: > https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp > File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): > > https://codereview.chromium.org/2157953002/diff/1/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode261 > ...
4 years, 5 months ago (2016-07-18 17:36:29 UTC) #9
xidachen
https://codereview.chromium.org/2157953002/diff/20001/third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html File third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html (right): https://codereview.chromium.org/2157953002/diff/20001/third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html#newcode88 third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html:88: shouldBe("sampleAlpha(noFilterData)", "sampleAlpha(lowData)"); Would this test enough? should I add ...
4 years, 5 months ago (2016-07-18 18:28:08 UTC) #11
Justin Novosad
https://codereview.chromium.org/2157953002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2157953002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode946 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:946: return dstRect.width() < srcRect.width() && dstRect.height() < srcRect.height(); This ...
4 years, 5 months ago (2016-07-19 17:17:17 UTC) #12
xidachen
https://codereview.chromium.org/2157953002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2157953002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode946 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:946: return dstRect.width() < srcRect.width() && dstRect.height() < srcRect.height(); On ...
4 years, 5 months ago (2016-07-20 11:16:02 UTC) #13
Justin Novosad
https://codereview.chromium.org/2157953002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2157953002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode980 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:980: if (!imageSmoothingEnabled() && isDrawScalingDown(srcRect, state().transform().mapRect(dstRect))) Using mapRect is not ...
4 years, 5 months ago (2016-07-20 17:36:36 UTC) #14
xidachen
https://codereview.chromium.org/2157953002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2157953002/diff/60001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode980 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:980: if (!imageSmoothingEnabled() && isDrawScalingDown(srcRect, state().transform().mapRect(dstRect))) On 2016/07/20 17:36:36, Justin ...
4 years, 5 months ago (2016-07-20 19:13:50 UTC) #15
Justin Novosad
https://codereview.chromium.org/2157953002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2157953002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode946 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:946: return dstRect.width() * xScale < srcRect.width() && dstRect.height() * ...
4 years, 5 months ago (2016-07-20 19:43:56 UTC) #16
xidachen
https://codereview.chromium.org/2157953002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2157953002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode946 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:946: return dstRect.width() * xScale < srcRect.width() && dstRect.height() * ...
4 years, 5 months ago (2016-07-20 20:31:33 UTC) #17
Justin Novosad
lgtm
4 years, 5 months ago (2016-07-20 20:49:49 UTC) #18
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/2157953002/120001
4 years, 5 months ago (2016-07-21 12:20:52 UTC) #29
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 5 months ago (2016-07-21 12:24:29 UTC) #31
commit-bot: I haz the power
4 years, 5 months ago (2016-07-21 12:26:19 UTC) #33
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/6ea454313e099cb68ea91d31ef8f2f54ac4c393c
Cr-Commit-Position: refs/heads/master@{#406824}

Powered by Google App Engine
This is Rietveld 408576698