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

Issue 2293573002: Add tinted static UI resource cache (Closed)

Created:
4 years, 3 months ago by mdjones
Modified:
4 years, 2 months ago
CC:
ajuma, cc-bugs_chromium.org, chromium-reviews, oshima+watch_chromium.org, vmpstr
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add tinted static UI resource cache This change adds a method to the ResourceManager that allows users to create a tinted version of a static resource. These resources are cached until the layout changes. In practice, this new functionality is used to tint the border resource and close button in the tab switcher. BUG=641517 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/4adb368fd86135a5f3f888895640b776395356b8 Cr-Commit-Position: refs/heads/master@{#417482}

Patch Set 1 #

Patch Set 2 : clean up #

Total comments: 12

Patch Set 3 : address comments #

Total comments: 8

Patch Set 4 : address vmpstr comments #

Total comments: 1

Patch Set 5 : update cache max size #

Patch Set 6 : fix lint #

Patch Set 7 : fix text color when cache is full #

Total comments: 2

Patch Set 8 : use custom caching mechanism #

Total comments: 18

Patch Set 9 : address comments #

Total comments: 2

Patch Set 10 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -40 lines) Patch
M cc/resources/ui_resource_bitmap.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M cc/resources/ui_resource_bitmap.cc View 1 2 3 4 5 6 2 chunks +9 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/android/compositor/layer/tab_layer.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/android/compositor/layer/tab_layer.cc View 1 2 3 4 5 6 7 6 chunks +4 lines, -33 lines 0 comments Download
M chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -2 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/ResourceManager.java View 2 chunks +9 lines, -0 lines 0 comments Download
M ui/android/resources/resource_manager.h View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -0 lines 0 comments Download
M ui/android/resources/resource_manager_impl.h View 1 2 3 4 5 6 7 8 4 chunks +10 lines, -0 lines 0 comments Download
M ui/android/resources/resource_manager_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +75 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 35 (9 generated)
mdjones
ptal
4 years, 3 months ago (2016-08-29 18:14:24 UTC) #3
David Trainor- moved to gerrit
https://codereview.chromium.org/2293573002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java File chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java (right): https://codereview.chromium.org/2293573002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java#newcode1182 chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java:1182: mResourceManager = resourceManager; Would it be cleaner to add ...
4 years, 3 months ago (2016-08-30 19:27:32 UTC) #4
mdjones
https://codereview.chromium.org/2293573002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java File chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java (right): https://codereview.chromium.org/2293573002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java#newcode1182 chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java:1182: mResourceManager = resourceManager; On 2016/08/30 19:27:32, David Trainor wrote: ...
4 years, 3 months ago (2016-08-30 21:52:16 UTC) #5
David Trainor- moved to gerrit
lgtm!
4 years, 3 months ago (2016-08-31 05:23:09 UTC) #6
mdjones
+vmpstr@ for cc/resources. Let me know if you're not the correct reviewer for this. Thanks!
4 years, 3 months ago (2016-08-31 15:51:40 UTC) #8
aelias_OOO_until_Jul13
https://codereview.chromium.org/2293573002/diff/40001/chrome/browser/android/compositor/layer/tab_layer.cc File chrome/browser/android/compositor/layer/tab_layer.cc (left): https://codereview.chromium.org/2293573002/diff/40001/chrome/browser/android/compositor/layer/tab_layer.cc#oldcode641 chrome/browser/android/compositor/layer/tab_layer.cc:641: filters->Append(cc::FilterOperation::CreateColorMatrixFilter(colorMatrix)); I happened to notice this on my queue, ...
4 years, 3 months ago (2016-08-31 17:12:26 UTC) #10
mdjones
https://codereview.chromium.org/2293573002/diff/40001/chrome/browser/android/compositor/layer/tab_layer.cc File chrome/browser/android/compositor/layer/tab_layer.cc (left): https://codereview.chromium.org/2293573002/diff/40001/chrome/browser/android/compositor/layer/tab_layer.cc#oldcode641 chrome/browser/android/compositor/layer/tab_layer.cc:641: filters->Append(cc::FilterOperation::CreateColorMatrixFilter(colorMatrix)); On 2016/08/31 17:12:26, aelias wrote: > I happened ...
4 years, 3 months ago (2016-08-31 17:41:00 UTC) #11
mdjones
https://codereview.chromium.org/2293573002/diff/40001/ui/android/resources/resource_manager_impl.cc File ui/android/resources/resource_manager_impl.cc (right): https://codereview.chromium.org/2293573002/diff/40001/ui/android/resources/resource_manager_impl.cc#newcode34 ui/android/resources/resource_manager_impl.cc:34: const int kMaxTintResourceCount = 30; I can also reduce ...
4 years, 3 months ago (2016-08-31 17:49:12 UTC) #12
aelias_OOO_until_Jul13
https://codereview.chromium.org/2293573002/diff/40001/chrome/browser/android/compositor/layer/tab_layer.cc File chrome/browser/android/compositor/layer/tab_layer.cc (left): https://codereview.chromium.org/2293573002/diff/40001/chrome/browser/android/compositor/layer/tab_layer.cc#oldcode641 chrome/browser/android/compositor/layer/tab_layer.cc:641: filters->Append(cc::FilterOperation::CreateColorMatrixFilter(colorMatrix)); On 2016/08/31 at 17:41:00, mdjones wrote: > I ...
4 years, 3 months ago (2016-08-31 18:01:32 UTC) #13
vmpstr
cc lgtm (didn't take a look at the rest) https://codereview.chromium.org/2293573002/diff/40001/cc/resources/ui_resource_bitmap.h File cc/resources/ui_resource_bitmap.h (right): https://codereview.chromium.org/2293573002/diff/40001/cc/resources/ui_resource_bitmap.h#newcode41 cc/resources/ui_resource_bitmap.h:41: ...
4 years, 3 months ago (2016-08-31 18:01:56 UTC) #15
mdjones
https://codereview.chromium.org/2293573002/diff/40001/cc/resources/ui_resource_bitmap.h File cc/resources/ui_resource_bitmap.h (right): https://codereview.chromium.org/2293573002/diff/40001/cc/resources/ui_resource_bitmap.h#newcode41 cc/resources/ui_resource_bitmap.h:41: void Draw(SkCanvas& canvas, SkPaint& paint); On 2016/08/31 18:01:55, vmpstr ...
4 years, 3 months ago (2016-08-31 21:17:01 UTC) #16
aelias_OOO_until_Jul13
https://codereview.chromium.org/2293573002/diff/60001/ui/android/resources/resource_manager_impl.cc File ui/android/resources/resource_manager_impl.cc (right): https://codereview.chromium.org/2293573002/diff/60001/ui/android/resources/resource_manager_impl.cc#newcode34 ui/android/resources/resource_manager_impl.cc:34: const int kMaxTintResourceCount = 30; We chatted offline and ...
4 years, 3 months ago (2016-08-31 23:37:45 UTC) #17
aelias_OOO_until_Jul13
lgtm
4 years, 3 months ago (2016-09-01 01:45:05 UTC) #18
mdjones
This patch needs a bit more work. I found a bug related to the cache ...
4 years, 3 months ago (2016-09-01 17:49:46 UTC) #19
mdjones
Updated patch to kill the text color bug. ptal, thanks!
4 years, 3 months ago (2016-09-02 20:48:54 UTC) #20
aelias_OOO_until_Jul13
https://codereview.chromium.org/2293573002/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java File chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java (right): https://codereview.chromium.org/2293573002/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java#newcode104 chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java:104: getUpdatedTitleWithThemeColor(tab, "", themeColor); It's weird to override the tab's ...
4 years, 3 months ago (2016-09-03 08:01:46 UTC) #21
mdjones
https://codereview.chromium.org/2293573002/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java File chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java (right): https://codereview.chromium.org/2293573002/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java#newcode104 chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java:104: getUpdatedTitleWithThemeColor(tab, "", themeColor); On 2016/09/03 08:01:46, aelias wrote: > ...
4 years, 3 months ago (2016-09-06 16:21:25 UTC) #22
mdjones
On 2016/09/06 16:21:25, mdjones wrote: > https://codereview.chromium.org/2293573002/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java > File > chrome/android/java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java > (right): > > ...
4 years, 3 months ago (2016-09-06 16:53:05 UTC) #23
mdjones
The resource cache is now based on the number of tabs that are showing. When ...
4 years, 3 months ago (2016-09-07 15:34:49 UTC) #24
aelias_OOO_until_Jul13
Just for clarity, "not lgtm" yet, although generally-speaking caching approach looks great and I just ...
4 years, 3 months ago (2016-09-07 19:34:44 UTC) #25
mdjones
https://codereview.chromium.org/2293573002/diff/140001/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc File chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc (right): https://codereview.chromium.org/2293573002/diff/140001/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc#newcode58 chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc:58: if (resource_manager_) resource_manager_->RemoveUnusedTints(used_tints_); On 2016/09/07 19:34:44, aelias wrote: > ...
4 years, 3 months ago (2016-09-08 16:34:44 UTC) #26
aelias_OOO_until_Jul13
lgtm https://codereview.chromium.org/2293573002/diff/160001/ui/android/resources/resource_manager_impl.cc File ui/android/resources/resource_manager_impl.cc (right): https://codereview.chromium.org/2293573002/diff/160001/ui/android/resources/resource_manager_impl.cc#newcode182 ui/android/resources/resource_manager_impl.cc:182: nit: unnecessary newline
4 years, 3 months ago (2016-09-08 22:04:41 UTC) #27
mdjones
https://codereview.chromium.org/2293573002/diff/160001/ui/android/resources/resource_manager_impl.cc File ui/android/resources/resource_manager_impl.cc (right): https://codereview.chromium.org/2293573002/diff/160001/ui/android/resources/resource_manager_impl.cc#newcode182 ui/android/resources/resource_manager_impl.cc:182: On 2016/09/08 22:04:41, aelias wrote: > nit: unnecessary newline ...
4 years, 3 months ago (2016-09-09 01:19:15 UTC) #28
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/2293573002/180001
4 years, 3 months ago (2016-09-09 01:19:43 UTC) #31
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 3 months ago (2016-09-09 02:36:18 UTC) #32
commit-bot: I haz the power
4 years, 3 months ago (2016-09-09 02:37:51 UTC) #34
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/4adb368fd86135a5f3f888895640b776395356b8
Cr-Commit-Position: refs/heads/master@{#417482}

Powered by Google App Engine
This is Rietveld 408576698