CC:
chromium-reviews, Ian Vollick, sievers+watch_chromium.org, jbauman+watch_chromium.org, oshima+watch_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, cc-bugs_chromium.org, Ken Russell (switch to Gerrit)
Change ui::wm::Shadow to use cc::NinePatchLayer.
Added combined shadow assets used by the class ui::wm::Shadow and remove the unneeded
assets for individual shadow patches.
BUG=377319
TEST=run 1.0x, 1.25x and 2.0x scale factor and verify all shadows are rendered correctly.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283558
6 years, 5 months ago
(2014-07-11 20:59:40 UTC)
#1
PTAL
hshi1
PTAL patch set #2. I talked to oshima@ and realized that the aperture/border needs to ...
6 years, 5 months ago
(2014-07-11 22:47:40 UTC)
#2
PTAL patch set #2. I talked to oshima@ and realized that the aperture/border
needs to be separate from the inset.
With the new patch I have verified that the inner rounded corner is correctly
rendered (with a test shadow image that has bright colorful corner colors)
oshima
thanks. lgtm with a nit. https://codereview.chromium.org/385123005/diff/1/ui/resources/ui_resources.grd File ui/resources/ui_resources.grd (right): https://codereview.chromium.org/385123005/diff/1/ui/resources/ui_resources.grd#newcode106 ui/resources/ui_resources.grd:106: <structure type="chrome_scaled_image" name="IDR_AURA_SHADOW_INACTIVE" file="common/window_shadow_inactive.png" ...
6 years, 5 months ago
(2014-07-11 23:03:41 UTC)
#3
https://codereview.chromium.org/385123005/diff/40001/ui/compositor/layer.cc File ui/compositor/layer.cc (right): https://codereview.chromium.org/385123005/diff/40001/ui/compositor/layer.cc#newcode592 ui/compositor/layer.cc:592: SetFillsBoundsOpaquely(false); Why the SetFillsBoundsOpaquely here? Isn't that separate from ...
6 years, 5 months ago
(2014-07-14 15:30:06 UTC)
#5
https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc File ui/wm/core/shadow.cc (left): https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc#oldcode140 ui/wm/core/shadow.cc:140: &res.GetImageNamed(IDR_AURA_SHADOW_ACTIVE_TOP_LEFT), On 2014/07/14 21:23:37, hshi1 wrote: > On 2014/07/14 ...
6 years, 5 months ago
(2014-07-14 22:02:32 UTC)
#8
https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc
File ui/wm/core/shadow.cc (left):
https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc#old...
ui/wm/core/shadow.cc:140: &res.GetImageNamed(IDR_AURA_SHADOW_ACTIVE_TOP_LEFT),
On 2014/07/14 21:23:37, hshi1 wrote:
> On 2014/07/14 15:30:06, sky wrote:
> > This is the more common style used in chrome. See also
> > ui/gfx/nine_image_painter. Is there a reason for not going with separate
> images?
> > The advantage of separate images is that updated them doesn't require
updating
> > code (the apeture values you have I believe).
>
> While I agree of the advantage of separate images, the existing design of
> cc::NinePatchLayer requires a single image. My understand is that (ccameron@
> please correct me) the NinePatch layer implementation takes advantage of the
> single image to allow seamless scaling with fractional scaling factors such as
> 1.25x -- something very hard to do with multiple separate images.
>
> If we go with separate images then we'll need a wrapper to combine these
images
> at run time, and allocate a temporary buffer to hold the combined images (for
> every style). It feels like the unnecessary complexity outweighs the benefits.
I actually prefer single image and would like nine painter to adopt it. It's
less error prone (no way to mix up wrong images, and they're consistent),
easy to maintain (one image vs 8 images), and simpler code.
The code update issue can be addressed by embedding this information in the
image like
Android does.
Note that this particular patch uses the nine patch in special way,
so it can require the code change even if we uses separate images.
(aperture and insets are different)
sky
On Mon, Jul 14, 2014 at 3:02 PM, <oshima@chromium.org> wrote: > > https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc > File ...
6 years, 5 months ago
(2014-07-15 04:11:11 UTC)
#9
On Mon, Jul 14, 2014 at 3:02 PM, <oshima@chromium.org> wrote:
>
> https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc
> File ui/wm/core/shadow.cc (left):
>
> https://codereview.chromium.org/385123005/diff/40001/ui/
> wm/core/shadow.cc#oldcode140
> ui/wm/core/shadow.cc:140:
> &res.GetImageNamed(IDR_AURA_SHADOW_ACTIVE_TOP_LEFT),
> On 2014/07/14 21:23:37, hshi1 wrote:
>
>> On 2014/07/14 15:30:06, sky wrote:
>> > This is the more common style used in chrome. See also
>> > ui/gfx/nine_image_painter. Is there a reason for not going with
>>
> separate
>
>> images?
>> > The advantage of separate images is that updated them doesn't
>>
> require updating
>
>> > code (the apeture values you have I believe).
>>
>
> While I agree of the advantage of separate images, the existing design
>>
> of
>
>> cc::NinePatchLayer requires a single image. My understand is that
>>
> (ccameron@
>
>> please correct me) the NinePatch layer implementation takes advantage
>>
> of the
>
>> single image to allow seamless scaling with fractional scaling factors
>>
> such as
>
>> 1.25x -- something very hard to do with multiple separate images.
>>
>
> If we go with separate images then we'll need a wrapper to combine
>>
> these images
>
>> at run time, and allocate a temporary buffer to hold the combined
>>
> images (for
>
>> every style). It feels like the unnecessary complexity outweighs the
>>
> benefits.
>
> I actually prefer single image and would like nine painter to adopt it.
> It's
> less error prone (no way to mix up wrong images, and they're
> consistent),
> easy to maintain (one image vs 8 images), and simpler code.
>
> The code update issue can be addressed by embedding this information in
> the image like
> Android does.
>
> Note that this particular patch uses the nine patch in special way,
> so it can require the code change even if we uses separate images.
> (aperture and insets are different)
I seem to remember some of the designers complaining about a single image
and the need to use a separate tool to update meta information. The
designers are going to be the ones that maintain these images, so it's
worth talking with them for their perspective. That said, I do like a
single image for the reasons you mention here too, but I want to see how
embedding extra info works in practice. Can we embed the extra state needed
here in the image too?
-Scott
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.
hshi1
On 2014/07/15 04:11:11, sky wrote: > On Mon, Jul 14, 2014 at 3:02 PM, <mailto:oshima@chromium.org> ...
6 years, 5 months ago
(2014-07-15 16:41:43 UTC)
#10
On 2014/07/15 04:11:11, sky wrote:
> On Mon, Jul 14, 2014 at 3:02 PM, <mailto:oshima@chromium.org> wrote:
>
> >
> > https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc
> > File ui/wm/core/shadow.cc (left):
> >
> > https://codereview.chromium.org/385123005/diff/40001/ui/
> > wm/core/shadow.cc#oldcode140
> > ui/wm/core/shadow.cc:140:
> > &res.GetImageNamed(IDR_AURA_SHADOW_ACTIVE_TOP_LEFT),
> > On 2014/07/14 21:23:37, hshi1 wrote:
> >
> >> On 2014/07/14 15:30:06, sky wrote:
> >> > This is the more common style used in chrome. See also
> >> > ui/gfx/nine_image_painter. Is there a reason for not going with
> >>
> > separate
> >
> >> images?
> >> > The advantage of separate images is that updated them doesn't
> >>
> > require updating
> >
> >> > code (the apeture values you have I believe).
> >>
> >
> > While I agree of the advantage of separate images, the existing design
> >>
> > of
> >
> >> cc::NinePatchLayer requires a single image. My understand is that
> >>
> > (ccameron@
> >
> >> please correct me) the NinePatch layer implementation takes advantage
> >>
> > of the
> >
> >> single image to allow seamless scaling with fractional scaling factors
> >>
> > such as
> >
> >> 1.25x -- something very hard to do with multiple separate images.
> >>
> >
> > If we go with separate images then we'll need a wrapper to combine
> >>
> > these images
> >
> >> at run time, and allocate a temporary buffer to hold the combined
> >>
> > images (for
> >
> >> every style). It feels like the unnecessary complexity outweighs the
> >>
> > benefits.
> >
> > I actually prefer single image and would like nine painter to adopt it.
> > It's
> > less error prone (no way to mix up wrong images, and they're
> > consistent),
> > easy to maintain (one image vs 8 images), and simpler code.
> >
> > The code update issue can be addressed by embedding this information in
> > the image like
> > Android does.
> >
> > Note that this particular patch uses the nine patch in special way,
> > so it can require the code change even if we uses separate images.
> > (aperture and insets are different)
>
>
> I seem to remember some of the designers complaining about a single image
> and the need to use a separate tool to update meta information. The
> designers are going to be the ones that maintain these images, so it's
> worth talking with them for their perspective. That said, I do like a
> single image for the reasons you mention here too, but I want to see how
> embedding extra info works in practice. Can we embed the extra state needed
> here in the image too?
>
> -Scott
>
> To unsubscribe from this group and stop receiving emails from it, send an
email
> to mailto:chromium-reviews+unsubscribe@chromium.org.
I have CCed sgabriel@ on the bug. But I am not aware of any method to embed the
additional information (inset and aperture values) in the image itself.
hshi1
per sgabriel (see bug comments) this is an acceptable solution for designers. thanks!
6 years, 5 months ago
(2014-07-15 17:05:49 UTC)
#11
per sgabriel (see bug comments) this is an acceptable solution for designers.
thanks!
oshima
On 2014/07/15 16:41:43, hshi1 wrote: > On 2014/07/15 04:11:11, sky wrote: > > On Mon, ...
6 years, 5 months ago
(2014-07-15 17:20:38 UTC)
#12
On 2014/07/15 16:41:43, hshi1 wrote:
> On 2014/07/15 04:11:11, sky wrote:
> > On Mon, Jul 14, 2014 at 3:02 PM, <mailto:oshima@chromium.org> wrote:
> >
> > >
> > > https://codereview.chromium.org/385123005/diff/40001/ui/wm/core/shadow.cc
> > > File ui/wm/core/shadow.cc (left):
> > >
> > > https://codereview.chromium.org/385123005/diff/40001/ui/
> > > wm/core/shadow.cc#oldcode140
> > > ui/wm/core/shadow.cc:140:
> > > &res.GetImageNamed(IDR_AURA_SHADOW_ACTIVE_TOP_LEFT),
> > > On 2014/07/14 21:23:37, hshi1 wrote:
> > >
> > >> On 2014/07/14 15:30:06, sky wrote:
> > >> > This is the more common style used in chrome. See also
> > >> > ui/gfx/nine_image_painter. Is there a reason for not going with
> > >>
> > > separate
> > >
> > >> images?
> > >> > The advantage of separate images is that updated them doesn't
> > >>
> > > require updating
> > >
> > >> > code (the apeture values you have I believe).
> > >>
> > >
> > > While I agree of the advantage of separate images, the existing design
> > >>
> > > of
> > >
> > >> cc::NinePatchLayer requires a single image. My understand is that
> > >>
> > > (ccameron@
> > >
> > >> please correct me) the NinePatch layer implementation takes advantage
> > >>
> > > of the
> > >
> > >> single image to allow seamless scaling with fractional scaling factors
> > >>
> > > such as
> > >
> > >> 1.25x -- something very hard to do with multiple separate images.
> > >>
> > >
> > > If we go with separate images then we'll need a wrapper to combine
> > >>
> > > these images
> > >
> > >> at run time, and allocate a temporary buffer to hold the combined
> > >>
> > > images (for
> > >
> > >> every style). It feels like the unnecessary complexity outweighs the
> > >>
> > > benefits.
> > >
> > > I actually prefer single image and would like nine painter to adopt it.
> > > It's
> > > less error prone (no way to mix up wrong images, and they're
> > > consistent),
> > > easy to maintain (one image vs 8 images), and simpler code.
> > >
> > > The code update issue can be addressed by embedding this information in
> > > the image like
> > > Android does.
> > >
> > > Note that this particular patch uses the nine patch in special way,
> > > so it can require the code change even if we uses separate images.
> > > (aperture and insets are different)
> >
> >
> > I seem to remember some of the designers complaining about a single image
> > and the need to use a separate tool to update meta information. The
> > designers are going to be the ones that maintain these images, so it's
> > worth talking with them for their perspective. That said, I do like a
> > single image for the reasons you mention here too, but I want to see how
> > embedding extra info works in practice. Can we embed the extra state needed
> > here in the image too?
> >
> > -Scott
> >
> > To unsubscribe from this group and stop receiving emails from it, send an
> email
> > to mailto:chromium-reviews+unsubscribe@chromium.org.
>
> I have CCed sgabriel@ on the bug. But I am not aware of any method to embed
the
> additional information (inset and aperture values) in the image itself.
I'll work on it, as it also requires some change on Image loading and resource
management side.
We can take and update the ccameron's script to embed such information.
I'll go with the same format as android although It will be a subset of android
spec as android does more than what we need. (see
http://blog.fenrir-inc.com/us/2012/02/android-design-enlarge-images-with-nine...)
sky
https://codereview.chromium.org/385123005/diff/80001/ui/compositor/layer.cc File ui/compositor/layer.cc (right): https://codereview.chromium.org/385123005/diff/80001/ui/compositor/layer.cc#newcode602 ui/compositor/layer.cc:602: if (type_ == LAYER_SOLID_COLOR || (!delegate_ && !mailbox_.IsValid())) Should ...
6 years, 5 months ago
(2014-07-15 17:52:20 UTC)
#13
https://codereview.chromium.org/385123005/diff/80001/ui/compositor/layer.cc File ui/compositor/layer.cc (right): https://codereview.chromium.org/385123005/diff/80001/ui/compositor/layer.cc#newcode591 ui/compositor/layer.cc:591: if (!nine_patch_layer_.get()) You DCHECK'd this won't happen, so please ...
6 years, 5 months ago
(2014-07-15 17:53:34 UTC)
#14
Note: the WebGLContextLostFromSelectElement failure looks real, and related to this patch. It stresses context loss ...
6 years, 5 months ago
(2014-07-15 19:04:35 UTC)
#17
Note: the WebGLContextLostFromSelectElement failure looks real, and related to
this patch. It stresses context loss in the compositor. Please tell me if you
think there's a problem in the test or if you have trouble reproducing it.
hshi1
On 2014/07/15 19:04:35, Ken Russell wrote: > Note: the WebGLContextLostFromSelectElement failure looks real, and related ...
6 years, 5 months ago
(2014-07-15 19:13:09 UTC)
#18
On 2014/07/15 19:04:35, Ken Russell wrote:
> Note: the WebGLContextLostFromSelectElement failure looks real, and related to
> this patch. It stresses context loss in the compositor. Please tell me if you
> think there's a problem in the test or if you have trouble reproducing it.
Thanks for catching this! Looks like we're failing a DCHECK because an immutable
bitmap is required.
hshi1
sky: PTAL - I believe PS#8 has eliminated the last few DCHECK failures in tests.
6 years, 5 months ago
(2014-07-16 18:16:30 UTC)
#19
sky: PTAL - I believe PS#8 has eliminated the last few DCHECK failures in tests.
sky
LGTM
6 years, 5 months ago
(2014-07-16 19:33:30 UTC)
#20
LGTM
hshi1
The CQ bit was checked by hshi@chromium.org
6 years, 5 months ago
(2014-07-16 20:13:58 UTC)
#21
Issue 385123005: Change ui::wm::Shadow to use cc::NinePatchLayer.
(Closed)
Created 6 years, 5 months ago by hshi1
Modified 6 years, 5 months ago
Reviewers: ccameron, oshima, sky, danakj, Ken Russell (switch to Gerrit)
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 22