|
|
Created:
5 years, 9 months ago by hshi1 Modified:
5 years, 9 months ago CC:
chromium-reviews, Ian Vollick, sievers+watch_chromium.org, jbauman+watch_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, cc-bugs_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionChange ui::wm::Shadow to pass ImageSkia instead of SkBitmap.
This allows ui::Layer to take scale factor into consideration when updating the cc::NinePatchLayer.
BUG=466950
R=danakj@chromium.org
R=oshima@chromium.org
TBR=sky@chromium.org
TEST=verify on HiDPI display as well as HiDPI + LowDPI extended mode that shadows are correct.
Committed: https://crrev.com/270f62296ebb49c6bcaff3dc8715346d3f0d321a
Cr-Commit-Position: refs/heads/master@{#320974}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Handle device scale factor change. #
Total comments: 4
Patch Set 3 : address Dana's comments. #
Messages
Total messages: 25 (8 generated)
hshi@chromium.org changed reviewers: + oshima@chromium.org, thakis@chromium.org
PTAL. This CL intends to let ui::Layer take care of device scale factor related calculations so that ui::wm::Shadow can simply pass the ImageSkia without worrying about the scale factor itself.
On 2015/03/14 01:20:15, hshi1 wrote: > PTAL. This CL intends to let ui::Layer take care of device scale factor related > calculations so that ui::wm::Shadow can simply pass the ImageSkia without > worrying about the scale factor itself. Hmm, please hold off reviewing as I'm still seeing some issues. It appears that ui::Layer::device_scale_factor_ is not always correct. For example on Pixel single display mode I'm seeing that the factor is still 1.0f for the Ash desktop context menus (change wallpaper / shelf position etc.), although window shadows layer do have 2.0f.
On 2015/03/14 01:38:48, hshi1 wrote: > On 2015/03/14 01:20:15, hshi1 wrote: > > PTAL. This CL intends to let ui::Layer take care of device scale factor > related > > calculations so that ui::wm::Shadow can simply pass the ImageSkia without > > worrying about the scale factor itself. > > Hmm, please hold off reviewing as I'm still seeing some issues. > > It appears that ui::Layer::device_scale_factor_ is not always correct. For > example on Pixel single display mode I'm seeing that the factor is still 1.0f > for the Ash desktop context menus (change wallpaper / shelf position etc.), > although window shadows layer do have 2.0f. It's 1.0f until it's added to the tree, and that's probably what you saw in Shadow::Init()
https://codereview.chromium.org/1002393002/diff/1/ui/compositor/layer.cc File ui/compositor/layer.cc (right): https://codereview.chromium.org/1002393002/diff/1/ui/compositor/layer.cc#newc... ui/compositor/layer.cc:82: nine_patch_layer_bitmap_scale_factor_(1.0f) { Why you need this? You should just use device_scale_factor_ https://codereview.chromium.org/1002393002/diff/1/ui/compositor/layer.cc#newc... ui/compositor/layer.cc:717: device_scale_factor_ = device_scale_factor; you need to update the image here.
PTAL patch set #2. I have verified that it handles device scale factor changes correctly. Thanks! https://codereview.chromium.org/1002393002/diff/1/ui/compositor/layer.cc File ui/compositor/layer.cc (right): https://codereview.chromium.org/1002393002/diff/1/ui/compositor/layer.cc#newc... ui/compositor/layer.cc:82: nine_patch_layer_bitmap_scale_factor_(1.0f) { On 2015/03/14 05:42:55, oshima wrote: > Why you need this? You should just use device_scale_factor_ Done. https://codereview.chromium.org/1002393002/diff/1/ui/compositor/layer.cc#newc... ui/compositor/layer.cc:717: device_scale_factor_ = device_scale_factor; On 2015/03/14 05:42:55, oshima wrote: > you need to update the image here. Done.
hshi@chromium.org changed reviewers: + danakj@chromium.org, piman@chromium.org - thakis@chromium.org
Nico is traveling. piman/danakj (OWNER of ui/compositor) can you review? Thanks!
Ping...? I think this is a fairly straightforward change, please?
LGTM https://codereview.chromium.org/1002393002/diff/20001/ui/compositor/layer.cc File ui/compositor/layer.cc (right): https://codereview.chromium.org/1002393002/diff/20001/ui/compositor/layer.cc#... ui/compositor/layer.cc:641: nine_patch_layer_aperture_ = aperture; can you add "in_dip" to this variable name? https://codereview.chromium.org/1002393002/diff/20001/ui/compositor/layer.cc#... ui/compositor/layer.cc:725: UpdateNinePatchLayerImage(nine_patch_layer_image_); Can you move these up by RecomputeDrwasContentAndUVRect() and RecomputePosition()? That way we compute things for |this| all in the same order relative to the OnDeviceScaleFactorChanged calls.
https://codereview.chromium.org/1002393002/diff/20001/ui/compositor/layer.cc File ui/compositor/layer.cc (right): https://codereview.chromium.org/1002393002/diff/20001/ui/compositor/layer.cc#... ui/compositor/layer.cc:641: nine_patch_layer_aperture_ = aperture; On 2015/03/17 17:59:40, danakj wrote: > can you add "in_dip" to this variable name? Done. https://codereview.chromium.org/1002393002/diff/20001/ui/compositor/layer.cc#... ui/compositor/layer.cc:725: UpdateNinePatchLayerImage(nine_patch_layer_image_); On 2015/03/17 17:59:40, danakj wrote: > Can you move these up by RecomputeDrwasContentAndUVRect() and > RecomputePosition()? That way we compute things for |this| all in the same order > relative to the OnDeviceScaleFactorChanged calls. Done.
The CQ bit was checked by hshi@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from danakj@chromium.org Link to the patchset: https://codereview.chromium.org/1002393002/#ps40001 (title: "address Dana's comments.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1002393002/40001
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by hshi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1002393002/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by hshi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1002393002/40001
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/270f62296ebb49c6bcaff3dc8715346d3f0d321a Cr-Commit-Position: refs/heads/master@{#320974} |