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

Issue 2746483003: ui/android: Fix Resource meta-data sharing with ResourceManager. (Closed)

Created:
3 years, 9 months ago by Khushal
Modified:
3 years, 9 months ago
CC:
chromium-reviews, oshima+watch_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ui/android: Fix Resource meta-data sharing with ResourceManager. The android native resource management system provides a ui::ResourceManager::Resource, which pulls data from the java Resource, to provide meta-data to the code building cc::Layers for drawing this resource. The resource exposes padding and aperture, which are well defined concepts for a nine-patch bitmap, but are arbitrarily set in all other cases. In static bitmaps they are set to the bitmap size, while for dynamic resources they could represent anything. The change pulls out a native Resource class which is a container for the UIResource built from the corresponding java resource. The java Resource API now has a method which lets it build its native representation that can hold the meta-data to be used for drawing it using a cc::Layer. Currently we still build a NinePatchResource for dynamic resources, follow up changes will fix that to add correct native Resource subclasses. BUG=700454 Review-Url: https://codereview.chromium.org/2746483003 Cr-Commit-Position: refs/heads/master@{#457655} Committed: https://chromium.googlesource.com/chromium/src/+/39c53dc5b763b6ac8e60c78ea32bb4e7ce7f009e

Patch Set 1 #

Total comments: 14

Patch Set 2 : address comments #

Total comments: 8

Patch Set 3 : .. #

Patch Set 4 : .. #

Patch Set 5 : .. #

Patch Set 6 : actually upload files #

Patch Set 7 : test #

Patch Set 8 : jni #

Unified diffs Side-by-side diffs Delta from patch set Stats (+572 lines, -400 lines) Patch
M chrome/browser/android/compositor/decoration_title.cc View 2 chunks +12 lines, -15 lines 0 comments Download
M chrome/browser/android/compositor/layer/contextual_search_layer.cc View 15 chunks +46 lines, -48 lines 0 comments Download
M chrome/browser/android/compositor/layer/overlay_panel_layer.cc View 7 chunks +28 lines, -37 lines 0 comments Download
M chrome/browser/android/compositor/layer/tab_handle_layer.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/android/compositor/layer/tab_handle_layer.cc View 6 chunks +30 lines, -30 lines 0 comments Download
M chrome/browser/android/compositor/layer/tab_layer.cc View 9 chunks +44 lines, -43 lines 0 comments Download
M chrome/browser/android/compositor/layer/toolbar_layer.cc View 4 chunks +32 lines, -29 lines 0 comments Download
M chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.cc View 7 chunks +29 lines, -34 lines 0 comments Download
M ui/android/BUILD.gn View 1 2 3 3 chunks +8 lines, -1 line 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/LayoutResource.java View 1 2 3 4 chunks +12 lines, -6 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/Resource.java View 1 2 3 2 chunks +10 lines, -7 lines 0 comments Download
A ui/android/java/src/org/chromium/ui/resources/ResourceFactory.java View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/ResourceManager.java View 1 2 3 5 chunks +3 lines, -10 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/dynamics/BitmapDynamicResource.java View 1 2 3 2 chunks +7 lines, -4 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/dynamics/ViewResourceAdapter.java View 1 2 3 4 2 chunks +10 lines, -7 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/sprites/CrushedSpriteResource.java View 1 2 3 2 chunks +7 lines, -5 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/statics/NinePatchData.java View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/statics/StaticResource.java View 1 2 3 3 chunks +8 lines, -7 lines 0 comments Download
A ui/android/resources/nine_patch_resource.h View 1 chunk +36 lines, -0 lines 0 comments Download
A ui/android/resources/nine_patch_resource.cc View 1 1 chunk +49 lines, -0 lines 0 comments Download
A ui/android/resources/resource.h View 1 1 chunk +44 lines, -0 lines 0 comments Download
A ui/android/resources/resource.cc View 1 chunk +32 lines, -0 lines 0 comments Download
A ui/android/resources/resource_factory.h View 1 2 3 4 5 1 chunk +16 lines, -0 lines 0 comments Download
A ui/android/resources/resource_factory.cc View 1 2 3 4 5 1 chunk +41 lines, -0 lines 0 comments Download
M ui/android/resources/resource_manager.h View 3 chunks +3 lines, -18 lines 0 comments Download
D ui/android/resources/resource_manager.cc View 1 chunk +0 lines, -43 lines 0 comments Download
M ui/android/resources/resource_manager_impl.h View 1 chunk +1 line, -8 lines 0 comments Download
M ui/android/resources/resource_manager_impl.cc View 1 2 3 6 chunks +23 lines, -42 lines 0 comments Download
M ui/android/resources/resource_manager_impl_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M ui/android/ui_android_jni_registrar.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (18 generated)
Khushal
It should be a completely mechanical change, I still have to test it out to ...
3 years, 9 months ago (2017-03-09 23:05:38 UTC) #2
mdjones
https://codereview.chromium.org/2746483003/diff/1/ui/android/resources/nine_patch_resource.cc File ui/android/resources/nine_patch_resource.cc (right): https://codereview.chromium.org/2746483003/diff/1/ui/android/resources/nine_patch_resource.cc#newcode13 ui/android/resources/nine_patch_resource.cc:13: DCHECK_EQ(Type::NINE_PATCH_BITMAP, resource->type()); Where is type_ set for this class? ...
3 years, 9 months ago (2017-03-10 18:12:00 UTC) #3
Khushal
Okay, I tested this with the tab switcher and overlay and the world does not ...
3 years, 9 months ago (2017-03-10 19:19:24 UTC) #4
mdjones
lgtm https://codereview.chromium.org/2746483003/diff/1/ui/android/resources/resource.cc File ui/android/resources/resource.cc (right): https://codereview.chromium.org/2746483003/diff/1/ui/android/resources/resource.cc#newcode14 ui/android/resources/resource.cc:14: Resource::Resource(Type type) : type_(type) {} On 2017/03/10 19:19:24, ...
3 years, 9 months ago (2017-03-13 16:47:06 UTC) #6
Khushal
+tedchoc since looks like David is OOO today. https://codereview.chromium.org/2746483003/diff/1/ui/android/resources/resource.cc File ui/android/resources/resource.cc (right): https://codereview.chromium.org/2746483003/diff/1/ui/android/resources/resource.cc#newcode14 ui/android/resources/resource.cc:14: Resource::Resource(Type ...
3 years, 9 months ago (2017-03-13 21:03:25 UTC) #8
Ted C
On 2017/03/13 21:03:25, Khushal wrote: > +tedchoc since looks like David is OOO today. I ...
3 years, 9 months ago (2017-03-13 23:08:33 UTC) #9
Khushal
On 2017/03/13 23:08:33, Ted C wrote: > On 2017/03/13 21:03:25, Khushal wrote: > > +tedchoc ...
3 years, 9 months ago (2017-03-13 23:38:30 UTC) #10
David Trainor- moved to gerrit
lgtm % nits! https://codereview.chromium.org/2746483003/diff/20001/ui/android/java/src/org/chromium/ui/resources/LayoutResource.java File ui/android/java/src/org/chromium/ui/resources/LayoutResource.java (right): https://codereview.chromium.org/2746483003/diff/20001/ui/android/java/src/org/chromium/ui/resources/LayoutResource.java#newcode20 ui/android/java/src/org/chromium/ui/resources/LayoutResource.java:20: public LayoutResource(float pxToDp, Resource resource) { ...
3 years, 9 months ago (2017-03-14 18:31:52 UTC) #11
Khushal
https://codereview.chromium.org/2746483003/diff/20001/ui/android/java/src/org/chromium/ui/resources/LayoutResource.java File ui/android/java/src/org/chromium/ui/resources/LayoutResource.java (right): https://codereview.chromium.org/2746483003/diff/20001/ui/android/java/src/org/chromium/ui/resources/LayoutResource.java#newcode20 ui/android/java/src/org/chromium/ui/resources/LayoutResource.java:20: public LayoutResource(float pxToDp, Resource resource) { On 2017/03/14 18:31:52, ...
3 years, 9 months ago (2017-03-15 01:50:06 UTC) #12
Khushal
https://codereview.chromium.org/2746483003/diff/20001/ui/android/java/src/org/chromium/ui/resources/LayoutResource.java File ui/android/java/src/org/chromium/ui/resources/LayoutResource.java (right): https://codereview.chromium.org/2746483003/diff/20001/ui/android/java/src/org/chromium/ui/resources/LayoutResource.java#newcode20 ui/android/java/src/org/chromium/ui/resources/LayoutResource.java:20: public LayoutResource(float pxToDp, Resource resource) { On 2017/03/15 01:50:06, ...
3 years, 9 months ago (2017-03-16 19:01:44 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2746483003/100001
3 years, 9 months ago (2017-03-16 19:04:06 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/251914)
3 years, 9 months ago (2017-03-16 19:33:27 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2746483003/120001
3 years, 9 months ago (2017-03-16 20:12:07 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/138446)
3 years, 9 months ago (2017-03-16 21:52:38 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2746483003/120001
3 years, 9 months ago (2017-03-16 22:08:48 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/138554)
3 years, 9 months ago (2017-03-16 23:45:08 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2746483003/140001
3 years, 9 months ago (2017-03-17 00:46:43 UTC) #33
commit-bot: I haz the power
3 years, 9 months ago (2017-03-17 01:58:57 UTC) #36
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/39c53dc5b763b6ac8e60c78ea32b...

Powered by Google App Engine
This is Rietveld 408576698