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

Issue 1937493002: cc: 9patch: fix shadow scaling issue (Closed)

Created:
4 years, 7 months ago by llandwerlin-old
Modified:
4 years, 6 months ago
CC:
cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, jbauman+watch_chromium.org, kalyank, piman+watch_chromium.org, sadrul, sievers+watch_chromium.org, Ian Vollick
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: 9patch: fix scaling shadow issue The NinePatchLayer receives parameters in different coordinate spaces (source image space & destination layer space). Unfortunately 8b134c7492731333fabeda5e358f0604ae5f565e made the assumption that scaling factors for both coordinate system would be the same. This isn't true as the image space might be scaled on hidpi display while the layer space is not yet scaled for hidpi, this happens later after the quads are emitted. BUG=607033 TEST=verify windows' shadows are visible on hidpi display (for example on link) CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Patch Set 1 #

Patch Set 2 : Drop my own debugging LOG(ERROR) #

Patch Set 3 : Fix invalid occlusion area #

Total comments: 6

Patch Set 4 : Split test helpers #

Total comments: 2

Patch Set 5 : Fix rounded corners #

Unified diffs Side-by-side diffs Delta from patch set Stats (+225 lines, -64 lines) Patch
M cc/layers/nine_patch_layer_impl.cc View 1 2 3 4 chunks +37 lines, -17 lines 0 comments Download
M cc/layers/nine_patch_layer_impl_unittest.cc View 1 2 3 11 chunks +147 lines, -34 lines 0 comments Download
M mash/wm/shadow.cc View 1 2 3 4 1 chunk +17 lines, -6 lines 0 comments Download
M ui/compositor/layer.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M ui/compositor/layer.cc View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M ui/wm/core/shadow.cc View 1 2 3 4 1 chunk +17 lines, -7 lines 0 comments Download

Messages

Total messages: 20 (5 generated)
llandwerlin-old
aelias@chromium.org: Please review changes in cc/ sky@chromium.org: Please review changes in ui/ oshima@: Tested this ...
4 years, 7 months ago (2016-04-29 17:14:16 UTC) #3
oshima
On 2016/04/29 17:14:16, llandwerlin wrote: > mailto:aelias@chromium.org: Please review changes in cc/ > > mailto:sky@chromium.org: ...
4 years, 7 months ago (2016-04-29 17:38:59 UTC) #5
llandwerlin-old
On 2016/04/29 17:38:59, oshima wrote: > On 2016/04/29 17:14:16, llandwerlin wrote: > > mailto:aelias@chromium.org: Please ...
4 years, 7 months ago (2016-04-29 18:10:35 UTC) #6
oshima
On 2016/04/29 18:10:35, llandwerlin wrote: > On 2016/04/29 17:38:59, oshima wrote: > > On 2016/04/29 ...
4 years, 7 months ago (2016-04-29 18:11:55 UTC) #7
llandwerlin-old
On 2016/04/29 18:11:55, oshima wrote: > On 2016/04/29 18:10:35, llandwerlin wrote: > > On 2016/04/29 ...
4 years, 7 months ago (2016-04-29 18:43:32 UTC) #8
oshima
On 2016/04/29 18:43:32, llandwerlin wrote: > On 2016/04/29 18:11:55, oshima wrote: > > On 2016/04/29 ...
4 years, 7 months ago (2016-04-29 18:45:58 UTC) #9
oshima
On 2016/04/29 18:43:32, llandwerlin wrote: > On 2016/04/29 18:11:55, oshima wrote: > > On 2016/04/29 ...
4 years, 7 months ago (2016-04-29 18:46:00 UTC) #10
llandwerlin-old
PTAL, Thanks.
4 years, 7 months ago (2016-05-03 11:42:20 UTC) #11
aelias_OOO_until_Jul13
https://codereview.chromium.org/1937493002/diff/40001/cc/layers/nine_patch_layer_impl.cc File cc/layers/nine_patch_layer_impl.cc (right): https://codereview.chromium.org/1937493002/diff/40001/cc/layers/nine_patch_layer_impl.cc#newcode87 cc/layers/nine_patch_layer_impl.cc:87: if (border_.x() == 0 || border_.y() == 0 || ...
4 years, 7 months ago (2016-05-05 04:17:57 UTC) #12
llandwerlin-old
PTAL. Sorry for this late update. I spent too much time on corner cases that ...
4 years, 7 months ago (2016-05-06 16:26:48 UTC) #13
aelias_OOO_until_Jul13
lgtm, thanks!
4 years, 7 months ago (2016-05-07 05:25:14 UTC) #14
llandwerlin-old
oshima@, sky@ : ping?
4 years, 7 months ago (2016-05-12 10:36:06 UTC) #15
oshima
I tested the patch at 2x, and the bottom left/right corners have no rounding. Can ...
4 years, 7 months ago (2016-05-13 17:32:50 UTC) #16
llandwerlin-old
Sorry I didn't noticed the lower corners. The rounding corners come from the shadow's image, ...
4 years, 7 months ago (2016-05-16 10:05:09 UTC) #18
oshima
4 years, 7 months ago (2016-05-16 17:31:52 UTC) #20
On 2016/05/16 10:05:09, llandwerlin wrote:
> Sorry I didn't noticed the lower corners.
> 
> The rounding corners come from the shadow's image, so we need to overdraw on
the
> window just by the size of the image's aperture.
> 
> https://codereview.chromium.org/1937493002/diff/60001/ui/compositor/layer.cc
> File ui/compositor/layer.cc (right):
> 
>
https://codereview.chromium.org/1937493002/diff/60001/ui/compositor/layer.cc#...
> ui/compositor/layer.cc:630: DCHECK(type_ == LAYER_NINE_PATCH &&
> nine_patch_layer_.get());
> On 2016/05/13 17:32:50, oshima wrote:
> > DCHECK_EQ
> 
> Done.

The corners looks okay now. Can yo add a test that can catch this issue?

I'll leave the rest to owners as I'm not the owner.

Powered by Google App Engine
This is Rietveld 408576698