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

Issue 655874 link

Starred by 3 users

Issue metadata

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

Blocking:
issue 667939
issue 557405
issue 655875



Sign in to add a comment

Mojo support for transporting gfx::Images via shared memory

Project Member Reported by msw@chromium.org, Oct 14 2016

Issue description

Mojo support for transporting gfx::Images via shared memory

We should have an easy and cheap way to pass gfx::Image (or similar) over Mojo.
This would help avoid some of the one-off work to optimize specific features.
(eg. Ash desktop wallpaper decoded in chrome utility process, used by ash, etc.)
 

Comment 1 by msw@chromium.org, Oct 14 2016

Blocking: 655875

Comment 2 Deleted

Comment 3 Deleted

Comment 4 by msw@chromium.org, Oct 18 2016

Blocking: 557405

Comment 5 by sky@chromium.org, Nov 22 2016

Blocking: 667939

Comment 6 by msw@chromium.org, Nov 22 2016

Cc: roc...@chromium.org sa...@chromium.org
Owner: msw@chromium.org
Status: Assigned (was: Untriaged)
Right, we'll also want this for app and window icons (for the shelf and titlebars).

I'll roughly need to use https://cs.chromium.org/chromium/src/mojo/public/cpp/system/buffer.h to:
1) Add struct traits for gfx::Image[Skia] that supports sharing memory.
2) Support sharing these (with shared memory handles) via serialized std::vector<uint8_t>.

The latter is needed for the generic mus window property transport values, see:
https://codereview.chromium.org/2519583002/diff/40001/ui/aura/mus/property_converter.cc#newcode57

+CC some folks for sanity-checking... I have no idea what I'm doing :)
Cc: sadrul@chromium.org
Do we need these images for any purpose other than putting them on the screen? GpuMemoryBuffer maybe?

I've read some more code and chatted briefly with danakj@. Notion for wallpaper: allocate a texture (say via GpuMemoryBuffer for zero-copy upload of the uncompressed bits), get a texture handle from it, wrap it a mailbox and send that wherever you want to draw (i.e. ash for the wallpaper)? WDYT?


Comment 9 by msw@chromium.org, Nov 23 2016

Thanks for weighing in; I'll look into this more closely next week.
Can views display these easily? (for icons in shelf items and window titlebars, etc.)
icons and stuff should probably use cc::UIResource and friends. I don't know how views would get access to that. Somewhere (under aura), there are ultimately cc layers that get sent to the display compositor and could use the mailbox tiles or UIResource instances. 
Project Member

Comment 11 by bugdroid1@chromium.org, Mar 27 2017

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

commit fda72a9f6483a0cf08aa68091eb8f8af464bec64
Author: xiyuan <xiyuan@chromium.org>
Date: Mon Mar 27 17:04:31 2017

ash: HiDPI user avatar for SessionController

- Add mojo structs for ImageSkia and ImageSkiaRep;
- Use ImageSkia instead of SkBitmap for user avatar;

BUG= 702689 ,  655874 
TBR=ben@chromium.org

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

[modify] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ash/common/system/user/tray_user.cc
[modify] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ash/common/system/user/user_card_view.cc
[modify] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ash/public/interfaces/BUILD.gn
[modify] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ash/public/interfaces/session_controller.mojom
[modify] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/chrome/browser/ui/ash/session_controller_client.cc
[modify] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/BUILD.gn
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/BUILD.gn
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/DEPS
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/OWNERS
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/image.mojom
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/image.typemap
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/image_skia_struct_traits.cc
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/image_skia_struct_traits.h
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/image_traits_test_service.mojom
[add] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/image/mojo/image_traits_unittest.cc
[modify] https://crrev.com/fda72a9f6483a0cf08aa68091eb8f8af464bec64/ui/gfx/typemaps.gni

Project Member

Comment 12 by bugdroid1@chromium.org, Oct 5 2017

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

commit 9fd29d0be03411ad61bc6902ddd8355caf865ab7
Author: Mike Wasserman <msw@chromium.org>
Date: Thu Oct 05 04:54:26 2017

Ash: Use HiDPI shelf icons and menu item images.

Replace 1x SkBitmaps in shelf mojo structs with ImageSkia.
Fixes shelf item icons and icons in application menus.

Revise unit tests to support the new handle-bearing struct.
(add a test service to echo ShelfItem for struct traits)

Bug:  655874 ,  771311 
Test: Shelf icons look good with --ash-host-window-bounds=1000x1000*2
Change-Id: I646b9c3f5cdb1aac1413a26f166e401968cec865
Reviewed-on: https://chromium-review.googlesource.com/699417
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506655}
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/cpp/BUILD.gn
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/cpp/OWNERS
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/cpp/shelf_struct_traits.cc
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/cpp/shelf_struct_traits.h
[add] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/cpp/shelf_struct_traits_test_service.mojom
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/cpp/shelf_struct_traits_unittest.cc
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/interfaces/BUILD.gn
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/interfaces/shelf.mojom
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/public/interfaces/shelf.typemap
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/shelf/shelf_application_menu_model.cc
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ash/shelf/shelf_context_menu_model.cc
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc
[modify] https://crrev.com/9fd29d0be03411ad61bc6902ddd8355caf865ab7/ui/gfx/image/mojo/image_traits_unittest.cc

Comment 13 by msw@chromium.org, Oct 5 2017

Cc: msw@chromium.org
Owner: xiy...@chromium.org
Status: Fixed (was: Assigned)
Xiyuan basically fixed this via the ImageSkia mojom struct with shared buffer handles.
Marking this Fixed, but we might want gfx::Image traits or further efficiency gains.

Sign in to add a comment