New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 675313 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Remove stretch_content_to_fill_bounds from cc::SurfaceLayer::SetSurfaceInfo

Project Member Reported by samans@chromium.org, Dec 17 2016

Issue description

Figure out if it's better to be a part of SurfaceInfo or a separate method such as SetStretchContentToFillBounds.
 
Blocking: 601863
Cc: rjkroege@chromium.org sadrul@chromium.org piman@chromium.org danakj@chromium.org fsam...@chromium.org enne@chromium.org
Components: Internals>MUS
Labels: Proj-Mustash-Mus Proj-Mustash-Mus-GPU

Comment 2 by danakj@chromium.org, Dec 29 2016

What problem is it creating where it is?

Comment 3 by danakj@chromium.org, Dec 29 2016

Cc: xlai@chromium.org

Comment 4 Deleted

Thinking out loud:

It's a nitpick at best, but I don't like it either as it is. Maybe that's because SurfaceLayer::SetSurfaceInfo is a bad name? I'm not sure. It feels like SetSurfaceInfo should just set the SurfaceInfo and not also other stuff.

Note that SurfaceInfo will be a struct that's sent over IPC and will be part of the Mus API. See  https://crbug.com/676375 . stretch_content_to_fill_bounds seems like an entirely client side property and shouldn't be part of SurfaceInfo.

If we think of cc::Layer and in particular cc::SurfaceLayer as part of the Mus client library then I think it's worthwhile to ask about what is the simplest, most intuitive API for clients. Of course, this is a matter of opinion, but I think it's fair to say that as a rule of thumb, the more knobs that need to be set to get something on screen initially makes an API harder to use. It seems nice to minimize the number of flags that need to be set to get something on screen while allowing for more customizability later.

With that reasoning, I think I'm in favor of SetStretchContentToFillBounds.
ok that's fine, I think the names just happened to collide here probably.. but the principle of a separate setter here seems okay.
I think once we do this, UpdateDrawsContent and SetNeedsPushProperties have to be called in each setter which means if we call both setters these methods will be called twice which I know is not wrong but I'm wondering about the effect on the performance. 
They just set some bits, have a look. The performance impact is during the next push properties, which is the same no matter how many times you called it.
Then a separate setter sounds very reasonable to me.
Project Member

Comment 10 by bugdroid1@chromium.org, Jan 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e8fd2e59b07fd42d8716675265d4b67419fcc726

commit e8fd2e59b07fd42d8716675265d4b67419fcc726
Author: samans <samans@chromium.org>
Date: Tue Jan 10 00:23:13 2017

Remove stretch_content_to_fill_bounds from cc::SurfaceLayer::SetSurfaceInfo

Currently cc::SurfaceLayer::SetSurfaceInfo takes in
stretch_content_to_fill_bounds which doesn't belong there because
the purpose of this method is to set SurfaceInfo and only SurfaceInfo.
A separate method called SetStretchContentToFillBounds is created
instead.

TBR=darin@chromium.org

BUG= 675313 
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2621653002
Cr-Commit-Position: refs/heads/master@{#442414}

[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/blimp/client/core/compositor/blimp_compositor.cc
[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/cc/layers/surface_layer.cc
[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/cc/layers/surface_layer.h
[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/cc/layers/surface_layer_unittest.cc
[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/content/renderer/child_frame_compositing_helper.cc
[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/ui/android/delegated_frame_host_android.cc
[modify] https://crrev.com/e8fd2e59b07fd42d8716675265d4b67419fcc726/ui/compositor/layer.cc

Status: Fixed (was: Untriaged)
Blocking: -601863
Components: -Internals>MUS Internals>Services>WindowService

Sign in to add a comment