Merge lp://staging/~3v1n0/libindicator/reduce-image-serialization into lp://staging/libindicator/14.04

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 526
Proposed branch: lp://staging/~3v1n0/libindicator/reduce-image-serialization
Merge into: lp://staging/libindicator/14.04
Diff against target: 136 lines (+44/-40)
1 file modified
libindicator/indicator-image-helper.c (+44/-40)
To merge this branch: bzr merge lp://staging/~3v1n0/libindicator/reduce-image-serialization
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Lars Karlitski (community) Approve
Review via email: mp+208736@code.staging.launchpad.net

Commit message

IndicatorImageHelper: always try to use a GIcon or the filename as source of the GdkImage

We don't need to fallback to pure pixbuf, unless an indicator provided a custom icon that is not in the current theme path.
This helps a lot in reducing the Unity7 workload as this decreases the cases where
we need to encode the pixbuf contents, send them via dbus to unity, encode them
back, reload to a new pixbuf...

Also thanks to this, the library clients can load the actual icon, scaled at the value they want.

Description of the change

Try to avoid image loading to a pixbuf, unless we can't export a GImage or a
filename

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

Yeah, I'd love to have this as well, but some of the icons aren't square and need different rescaling.

For example, this patch breaks indicator-power's icon. It's much smaller and blurry.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> Yeah, I'd love to have this as well, but some of the icons aren't square and
> need different rescaling.
>
> For example, this patch breaks indicator-power's icon. It's much smaller and
> blurry.

Well, not in unity [with lp:~3v1n0/unity/hidpi-better-scaling]... As we handle this thing at UI level (where it should be done imho), btw I've pushed also a change to the indicator-loader to show how to deal with this case.

I know it's something it would be nice to have at library level, but the gain in handling just image references is too high for us...
We could probably do the same thing I did here at unity-panel-service level (reading the "private" INDICATOR_NAMES_DATA, but I'd prefer to depend on an unstable data element like that).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

> Well, not in unity [with lp:~3v1n0/unity/hidpi-better-scaling]... As we handle
> this thing at UI level (where it should be done imho), btw I've pushed also a
> change to the indicator-loader to show how to deal with this case.

I totally agree that this is where it should be handled. I didn't know you already fixed it. Nice work!

There's a bigger margin around the menu item in the loader now, but the size of the pixbuf seems to be correct. (Doesn't need to be fixed, I'm just mentioning it.)

I'm fine with landing this after the hidpi unity branch landed. Thanks!

review: Approve
528. By Marco Trevisan (Treviño)

IndicatorLoader: Make sure that we load the icon at its original size, if not higher than IMAGE_SIZE

In this way icons such as the battery one won't be shrunk.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

So, I've pushed a new revision that handles the things in a different way: basically setting the pixel size to 0 makes gtk to load the icon at its full size; so we can safely do that if the actual icon size isn't bigger than the ICON_SIZE value.

In this way also gtk apps (such as the greeter) won't need any change to support these kinds of icons.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
529. By Marco Trevisan (Treviño)

IndicatorImageHelper: let's use the actual icon file if its height is less than ICON_SIZE

Revision history for this message
Lars Karlitski (larsu) wrote :

Works fine again after the latest changes. Thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches