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

Issue 1889153002: cc: nine patch: add occlusion support (Closed)

Created:
4 years, 8 months ago by llandwerlin-old
Modified:
4 years, 8 months ago
CC:
cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, jbauman+watch_chromium.org, kalyank, msw, 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: nine patch: add occlusion support When using a NinePatchLayer to draw shadows on windows on ChromeOS part of patches which are completely transparent are drawn on top of the window. This prevents for example videos to be promoted into layers. This patch introduce an optional property on the NinePatchLayer : layer_occlusion. When this property is set, we can use it to compute 12 patches to paint the shadow rather than 8 (center omitted). This prevents drawing on the window's content completely and allows layer promotion algorithms to promote the windows's content as layer if possible (in particular with videos). BUG=603866 TEST=cc_unittests --gtest_filter=NinePatchLayer* CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/8b134c7492731333fabeda5e358f0604ae5f565e Cr-Commit-Position: refs/heads/master@{#389770}

Patch Set 1 #

Patch Set 2 : Fix int/size_t compilation issue #

Total comments: 8

Patch Set 3 : Daniel's nits #

Total comments: 14

Patch Set 4 : sky & aelias' changes #

Total comments: 12

Patch Set 5 : Don't use pointers to std::vector #

Patch Set 6 : Fix std::move errors #

Patch Set 7 : Missing include #

Patch Set 8 : switch to std::unique_ptr #

Patch Set 9 : remove std::move #

Total comments: 1

Patch Set 10 : final nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+364 lines, -319 lines) Patch
M cc/layers/nine_patch_layer.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M cc/layers/nine_patch_layer.cc View 1 2 3 4 5 6 7 2 chunks +10 lines, -2 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.h View 1 2 3 4 5 6 7 8 9 3 chunks +51 lines, -15 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.cc View 1 2 3 4 5 6 7 8 9 7 chunks +226 lines, -238 lines 0 comments Download
M cc/layers/nine_patch_layer_impl_unittest.cc View 1 2 3 4 5 6 7 13 chunks +57 lines, -57 lines 0 comments Download
M mash/wm/shadow.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/compositor/layer.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M ui/compositor/layer.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M ui/wm/core/shadow.cc View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 40 (14 generated)
llandwerlin-old
danakj@chromium.org: Please review changes in cc/layers and ui/compositor. msw@chromium.org: Please review changes in mash. avi@chromium.org: ...
4 years, 8 months ago (2016-04-15 12:11:47 UTC) #3
Avi (use Gerrit)
I don't know this area of ui/. Based on blame, I'm tossing this to hshi ...
4 years, 8 months ago (2016-04-15 14:21:23 UTC) #6
Avi (use Gerrit)
On 2016/04/15 14:21:23, Avi (OOO 20 April - 2 May) wrote: > I don't know ...
4 years, 8 months ago (2016-04-15 14:21:46 UTC) #7
Daniel Erat
i wrote similar code for chrome os a long time ago, but i'm afraid that ...
4 years, 8 months ago (2016-04-15 15:38:45 UTC) #9
llandwerlin-old
https://codereview.chromium.org/1889153002/diff/20001/cc/layers/nine_patch_layer.h File cc/layers/nine_patch_layer.h (right): https://codereview.chromium.org/1889153002/diff/20001/cc/layers/nine_patch_layer.h#newcode44 cc/layers/nine_patch_layer.h:44: // |rect| is the space completly occluded by another ...
4 years, 8 months ago (2016-04-18 15:08:20 UTC) #10
msw
Scott would be a better reviewer for the mash change.
4 years, 8 months ago (2016-04-18 20:33:56 UTC) #12
sky
LGTM with some docs https://codereview.chromium.org/1889153002/diff/40001/ui/compositor/layer.h File ui/compositor/layer.h (right): https://codereview.chromium.org/1889153002/diff/40001/ui/compositor/layer.h#newcode307 ui/compositor/layer.h:307: void UpdateNinePatchOcclusion(const gfx::Rect& rect); These ...
4 years, 8 months ago (2016-04-18 21:10:04 UTC) #13
aelias_OOO_until_Jul13
Why is this new algorithm needed? Can't you get the same visual effect by changing ...
4 years, 8 months ago (2016-04-18 22:33:23 UTC) #14
llandwerlin-old
On 2016/04/18 22:33:23, aelias wrote: > Why is this new algorithm needed? Can't you get ...
4 years, 8 months ago (2016-04-19 11:20:35 UTC) #15
aelias_OOO_until_Jul13
Understood, I think I've convinced myself that your approach is needed. Because the ninepatch elements ...
4 years, 8 months ago (2016-04-20 05:54:57 UTC) #16
Avi (use Gerrit)
I'm off to vacation, but it looks like the other reviewers have this under control. ...
4 years, 8 months ago (2016-04-20 17:36:24 UTC) #18
llandwerlin-old
https://codereview.chromium.org/1889153002/diff/40001/cc/layers/nine_patch_layer.h File cc/layers/nine_patch_layer.h (right): https://codereview.chromium.org/1889153002/diff/40001/cc/layers/nine_patch_layer.h#newcode47 cc/layers/nine_patch_layer.h:47: void SetLayerOcclusion(const gfx::Rect& rect); On 2016/04/20 05:54:57, aelias wrote: ...
4 years, 8 months ago (2016-04-21 09:53:14 UTC) #19
aelias_OOO_until_Jul13
https://codereview.chromium.org/1889153002/diff/60001/cc/layers/nine_patch_layer_impl.cc File cc/layers/nine_patch_layer_impl.cc (right): https://codereview.chromium.org/1889153002/diff/60001/cc/layers/nine_patch_layer_impl.cc#newcode173 cc/layers/nine_patch_layer_impl.cc:173: // Helper values. nit: this says "Helper values" and ...
4 years, 8 months ago (2016-04-22 03:00:42 UTC) #20
aelias_OOO_until_Jul13
https://codereview.chromium.org/1889153002/diff/60001/cc/layers/nine_patch_layer_impl.cc File cc/layers/nine_patch_layer_impl.cc (right): https://codereview.chromium.org/1889153002/diff/60001/cc/layers/nine_patch_layer_impl.cc#newcode104 cc/layers/nine_patch_layer_impl.cc:104: std::vector<NinePatchLayerImpl::Patches> patches; patches.reserve(kMaxPatches); https://codereview.chromium.org/1889153002/diff/60001/cc/layers/nine_patch_layer_impl.cc#newcode168 cc/layers/nine_patch_layer_impl.cc:168: } return std::move(patches);
4 years, 8 months ago (2016-04-22 03:03:54 UTC) #21
llandwerlin-old
https://codereview.chromium.org/1889153002/diff/60001/cc/layers/nine_patch_layer_impl.cc File cc/layers/nine_patch_layer_impl.cc (right): https://codereview.chromium.org/1889153002/diff/60001/cc/layers/nine_patch_layer_impl.cc#newcode104 cc/layers/nine_patch_layer_impl.cc:104: On 2016/04/22 03:03:54, aelias wrote: > std::vector<NinePatchLayerImpl::Patches> patches; > ...
4 years, 8 months ago (2016-04-22 13:46:10 UTC) #22
llandwerlin-old
This doesn't seem to be accepted by the compiler : return std::move(patches); Should we use ...
4 years, 8 months ago (2016-04-22 14:41:11 UTC) #23
danakj
On Fri, Apr 22, 2016 at 7:41 AM, <lionel.g.landwerlin@intel.com> wrote: > This doesn't seem to ...
4 years, 8 months ago (2016-04-22 20:09:42 UTC) #24
aelias_OOO_until_Jul13
Sounds good, I'm still trying to master the rvalue reference rules. This should be equally ...
4 years, 8 months ago (2016-04-23 00:53:27 UTC) #25
danakj
On Fri, Apr 22, 2016 at 5:53 PM, <aelias@chromium.org> wrote: > Sounds good, I'm still ...
4 years, 8 months ago (2016-04-23 01:06:54 UTC) #26
aelias_OOO_until_Jul13
lgtm modulo remaining comment. https://codereview.chromium.org/1889153002/diff/160001/cc/layers/nine_patch_layer_impl.cc File cc/layers/nine_patch_layer_impl.cc (right): https://codereview.chromium.org/1889153002/diff/160001/cc/layers/nine_patch_layer_impl.cc#newcode98 cc/layers/nine_patch_layer_impl.cc:98: std::unique_ptr<std::vector<NinePatchLayerImpl::Patch>> OK then, please remove ...
4 years, 8 months ago (2016-04-23 01:14:00 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1889153002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1889153002/180001
4 years, 8 months ago (2016-04-25 16:53:36 UTC) #30
commit-bot: I haz the power
Failed to commit the patch.
4 years, 8 months ago (2016-04-25 17:48:02 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1889153002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1889153002/180001
4 years, 8 months ago (2016-04-26 13:35:50 UTC) #35
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 8 months ago (2016-04-26 13:40:01 UTC) #37
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/8b134c7492731333fabeda5e358f0604ae5f565e Cr-Commit-Position: refs/heads/master@{#389770}
4 years, 8 months ago (2016-04-26 13:41:38 UTC) #39
llandwerlin-old
4 years, 7 months ago (2016-05-16 17:16:37 UTC) #40
Message was sent while issue was closed.
A revert of this CL (patchset #10 id:180001) has been created in
https://codereview.chromium.org/1983803003/ by lionel.g.landwerlin@intel.com.

The reason for reverting is: Shadow are broken on HiDPI monitors. See
https://bugs.chromium.org/p/chromium/issues/detail?id=607033

More people are noticing this and the fix is not ready yet.
Let's revert this for now..

Powered by Google App Engine
This is Rietveld 408576698