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

Issue 2514303004: WIP - mask a view's layer by its view coordinates

Created:
4 years, 1 month ago by Evan Stade
Modified:
4 years ago
Reviewers:
danakj, sky
CC:
chromium-reviews, asanka, sadrul, yusukes+watch_chromium.org, Ian Vollick, tfarina, shuchen+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, oshima+watch_chromium.org, piman+watch_chromium.org, kalyank, danakj+watch_chromium.org, dbeam+watch-downloads_chromium.org, bruthig, Peter Kasting
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WIP - mask a view's layer by its view coordinates BUG=lots

Patch Set 1 #

Patch Set 2 : manual clip #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -3 lines) Patch
M ash/common/system/chromeos/ime_menu/ime_list_view.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/download/download_shelf_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/compositor/layer_delegate.h View 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/controls/button/md_text_button.h View 2 chunks +11 lines, -0 lines 0 comments Download
M ui/views/controls/button/md_text_button.cc View 1 4 chunks +47 lines, -0 lines 0 comments Download
M ui/views/view.cc View 1 2 chunks +6 lines, -1 line 3 comments Download

Messages

Total messages: 19 (2 generated)
Evan Stade
Hi Scott, Throughout MD work we've often had to add layers to views, and this ...
4 years, 1 month ago (2016-11-22 00:41:14 UTC) #2
sky
If you think we need this in a number of places than I'm fine with ...
4 years, 1 month ago (2016-11-22 01:02:27 UTC) #3
Peter Kasting
Would adding this mean we can get rid of a bunch of parent layers we ...
4 years, 1 month ago (2016-11-22 01:12:22 UTC) #4
Evan Stade
On 2016/11/22 01:12:22, Peter Kasting wrote: > Would adding this mean we can get rid ...
4 years, 1 month ago (2016-11-22 01:23:37 UTC) #5
bruthig
On 2016/11/22 01:23:37, Evan Stade wrote: > On 2016/11/22 01:12:22, Peter Kasting wrote: > > ...
4 years, 1 month ago (2016-11-22 01:44:09 UTC) #6
Evan Stade
On 2016/11/22 01:44:09, bruthig wrote: > On 2016/11/22 01:23:37, Evan Stade wrote: > > On ...
4 years, 1 month ago (2016-11-22 16:26:50 UTC) #7
Evan Stade
On 2016/11/22 16:26:50, Evan Stade wrote: > On 2016/11/22 01:44:09, bruthig wrote: > > On ...
4 years ago (2016-11-29 02:46:29 UTC) #9
sky
https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc#newcode826 ui/views/view.cc:826: clip_recorder.ClipRect(GetVisibleBounds()); Is this really enough? What happens if an ...
4 years ago (2016-11-29 18:08:13 UTC) #10
Evan Stade
https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc#newcode826 ui/views/view.cc:826: clip_recorder.ClipRect(GetVisibleBounds()); On 2016/11/29 18:08:13, sky wrote: > Is this ...
4 years ago (2016-11-29 18:38:01 UTC) #11
sky
https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc#newcode826 ui/views/view.cc:826: clip_recorder.ClipRect(GetVisibleBounds()); On 2016/11/29 18:38:01, Evan Stade wrote: > On ...
4 years ago (2016-11-29 20:27:09 UTC) #12
Evan Stade
On 2016/11/29 20:27:09, sky wrote: > https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc > File ui/views/view.cc (right): > > https://codereview.chromium.org/2514303004/diff/20001/ui/views/view.cc#newcode826 > ...
4 years ago (2016-11-30 00:09:39 UTC) #13
sky
In thinking about this a bit more the only way to really address this is ...
4 years ago (2016-11-30 00:13:47 UTC) #14
Evan Stade
On 2016/11/30 00:13:47, sky wrote: > In thinking about this a bit more the only ...
4 years ago (2016-11-30 00:50:14 UTC) #15
sky
On Tue, Nov 29, 2016 at 4:58 PM, <danakj@chromium.org> wrote: > On Tue, Nov 29, ...
4 years ago (2016-11-30 00:59:40 UTC) #16
danakj
On Tue, Nov 29, 2016 at 4:50 PM, <estade@chromium.org> wrote: > On 2016/11/30 00:13:47, sky ...
4 years ago (2016-11-30 01:04:59 UTC) #17
danakj
On Tue, Nov 29, 2016 at 7:33 PM, <danakj@chromium.org> wrote: > On Tue, Nov 29, ...
4 years ago (2016-11-30 03:35:42 UTC) #18
danakj
4 years ago (2016-11-30 03:40:31 UTC) #19
On Tue, Nov 29, 2016 at 4:59 PM, Scott Violet <sky@chromium.org> wrote:

> On Tue, Nov 29, 2016 at 4:58 PM,  <danakj@chromium.org> wrote:
> > On Tue, Nov 29, 2016 at 4:50 PM, <estade@chromium.org> wrote:
> >>
> >> On 2016/11/30 00:13:47, sky wrote:
> >> > In thinking about this a bit more the only way to really address this
> >> > is making a parent have a layer. I don't see any other way that
> >> > doesn't have some limitation that is easy to miss.
> >> >
> >> > -Scott
> >>
> >> I think in the limit that means that all views will have layers as we
> add
> >> more
> >> and more layers for reasons like ink drop ripples or wanting shnazzy
> >> animations,
> >> and parent layers to effect clipping. This is a constant source of
> gotchas
> >> because everything can seem to work fine until you discover some corner
> >> case
> >> where views start overlapping.
> >
> >
> > The more layers there are the more memory we use also.
>
> Is there a simple calculation for the cost of making a view have a
> layer? I would imagine it depends upon the size of the view, but I'm
> not positive there.
>

Right, ignoring the possibility where a whole tile is a single color and we
avoid this, each pixel of the layer takes up 4 bytes of memory. There's
some additional data structure overhead but it's smaller unless your layers
are like 2x2 or something :P  There's also complexity overhead as
compositor algorithms are often O(...something .. #layers .. something...).
And overdraw meaning more GL driver calls and memory bandwidth use, as each
pixel will be drawn to N times when N layers overlap it (modulo culling
when a layer or tile is fully hidden by an opaque thing above it).


>
>   -Scott
>
> >
> >>
> >>
> >> Anyway, I'm willing to set this aside and only come back to it if we
> have
> >> to.
> >>
> >>
> >> >
> >> > On Tue, Nov 29, 2016 at 4:09 PM, <mailto:estade@chromium.org> wrote:
> >> > > On 2016/11/29 20:27:09, sky wrote:
> >> > >>
> >> > >> https://codereview.chromium.org/2514303004/diff/20001/ui/vie
> ws/view.cc
> >> > >> File ui/views/view.cc (right):
> >> > >>
> >> > >>
> >> > >
> >> >
> >>
> >> https://codereview.chromium.org/2514303004/diff/20001/ui/vie
> ws/view.cc#newcode826
> >> > >> ui/views/view.cc:826: clip_recorder.ClipRect(GetVisibleBounds());
> >> > >> On 2016/11/29 18:38:01, Evan Stade wrote:
> >> > >> > On 2016/11/29 18:08:13, sky wrote:
> >> > >> > > Is this really enough? What happens if an animation occurs that
> >> > > effectively
> >> > >> > > moves the layer. Wouldn't the clip move with the layer, which
> >> > >> > > isn't
> >> > >> > > really
> >> > >> > waht
> >> > >> > > you want.
> >> > >> >
> >> > >> > when the layer is moved that affects the view's transform (as per
> >> > >> GetTransform),
> >> > >> > which is taken into account in GetVisibleBounds.
> >> > >>
> >> > >> That's assuming you end up here, right? If the layer is moved that
> is
> >> > >> not
> >> > >> necessarily the case.
> >> > >
> >> > > If that doesn't trigger a VisibleBoundsChanged notification (and it
> >> > > looks
> >> > > like
> >> > > it may not) we might need to introduce
> >> > > LayerDelegate::OnLayerTransformChanged,
> >> > > similar to the currently extant OnLayerBoundsChanged.
> >> > >
> >> > > https://codereview.chromium.org/2514303004/
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "Chromium-reviews" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> email
> >> > to mailto:chromium-reviews+unsubscribe@chromium.org.
> >> >
> >>
> >>
> >>
> >> https://codereview.chromium.org/2514303004/
> >
> >
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698