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

Issue 2772313004: [ash-md] WIP Added wallpaper color caching. (Closed)

Created:
3 years, 9 months ago by bruthig
Modified:
3 years, 7 months ago
Reviewers:
jonross, bshe, sky
CC:
chromium-reviews, alemate+watch_chromium.org, sadrul, achuith+watch_chromium.org, oshima+watch_chromium.org, kalyank, davemoore+watch_chromium.org, James Cook, jonross
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[ash-md] WIP Added wallpaper color caching. Extracting the color from the wallpaper is an expensive operation. This change adds a cache to prevent wasting cycles. TODO: - Use a unique image identifier. File path is most likely candidate. - Determine where the cache should be initialized - Implement cache purging - Add tests BUG=595010 TEST=TODO

Patch Set 1 #

Patch Set 2 : "Working'ish" prototype #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -1 line) Patch
M ash/common/wallpaper/wallpaper_controller.h View 1 3 chunks +8 lines, -1 line 0 comments Download
M ash/common/wallpaper/wallpaper_controller.cc View 1 5 chunks +25 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h View 1 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc View 1 5 chunks +27 lines, -0 lines 1 comment Download
M chrome/browser/prefs/browser_prefs.cc View 1 2 chunks +4 lines, -0 lines 1 comment Download
M chrome/browser/ui/ash/ash_init.cc View 1 2 chunks +11 lines, -0 lines 3 comments Download
M components/wallpaper/BUILD.gn View 1 2 chunks +4 lines, -0 lines 0 comments Download
A components/wallpaper/pref_based_wallpaper_color_cache.h View 1 1 chunk +42 lines, -0 lines 0 comments Download
A components/wallpaper/pref_based_wallpaper_color_cache.cc View 1 1 chunk +98 lines, -0 lines 2 comments Download
A components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc View 1 1 chunk +72 lines, -0 lines 4 comments Download
A components/wallpaper/wallpaper_color_cache.h View 1 chunk +32 lines, -0 lines 0 comments Download
M components/wallpaper/wallpaper_resizer.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
bruthig
Hi All, This CL still has some outstanding work to be done but I have ...
3 years, 8 months ago (2017-03-28 13:32:21 UTC) #3
jonross
https://codereview.chromium.org/2772313004/diff/20001/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc File chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc (right): https://codereview.chromium.org/2772313004/diff/20001/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc#newcode394 chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc:394: ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperColorCache( This pattern is the older method of having ...
3 years, 8 months ago (2017-03-28 14:33:30 UTC) #5
bruthig
https://codereview.chromium.org/2772313004/diff/20001/chrome/browser/ui/ash/ash_init.cc File chrome/browser/ui/ash/ash_init.cc (right): https://codereview.chromium.org/2772313004/diff/20001/chrome/browser/ui/ash/ash_init.cc#newcode109 chrome/browser/ui/ash/ash_init.cc:109: ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperColorCache( On 2017/03/28 14:33:28, jonross wrote: > This may ...
3 years, 8 months ago (2017-03-28 15:18:51 UTC) #6
jonross
https://codereview.chromium.org/2772313004/diff/20001/chrome/browser/ui/ash/ash_init.cc File chrome/browser/ui/ash/ash_init.cc (right): https://codereview.chromium.org/2772313004/diff/20001/chrome/browser/ui/ash/ash_init.cc#newcode109 chrome/browser/ui/ash/ash_init.cc:109: ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperColorCache( On 2017/03/28 15:18:50, bruthig wrote: > On 2017/03/28 ...
3 years, 8 months ago (2017-03-28 18:24:35 UTC) #7
bshe
https://codereview.chromium.org/2772313004/diff/20001/components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc File components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc (right): https://codereview.chromium.org/2772313004/diff/20001/components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc#newcode59 components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc:59: EXPECT_FALSE(cache_.GetColor(image_1, &color)); why do you want to purge the ...
3 years, 8 months ago (2017-03-28 21:33:26 UTC) #8
bruthig
https://codereview.chromium.org/2772313004/diff/20001/components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc File components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc (right): https://codereview.chromium.org/2772313004/diff/20001/components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc#newcode59 components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc:59: EXPECT_FALSE(cache_.GetColor(image_1, &color)); On 2017/03/28 21:33:26, bshe wrote: > why ...
3 years, 8 months ago (2017-03-28 21:35:51 UTC) #9
bshe
Also, it looks like that you have two parameters (LumaRange and SaturationRange) when calculate color. ...
3 years, 8 months ago (2017-03-29 01:38:08 UTC) #10
bruthig
On 2017/03/29 01:38:08, bshe wrote: > Also, it looks like that you have two parameters ...
3 years, 8 months ago (2017-03-29 01:43:48 UTC) #11
bshe
3 years, 8 months ago (2017-03-29 15:18:18 UTC) #12
On 2017/03/29 01:43:48, bruthig wrote:
> On 2017/03/29 01:38:08, bshe wrote:
> > Also, it looks like that you have two parameters (LumaRange and
> SaturationRange)
> > when calculate color. Are these pre user setting or global setting? If it is
> pre
> > user setting, using wallpaper id might not be enough to get the calculated
> > color?
> 
> The plan is for these to be global settings.  Although we may need to add
> special handling for users who have used non-default command line values. Or
we
> could incorporate that into the pref structure.  I'd rather shelve that convo
to
> settle the higher level design issues though.

Hmm. If user could change it through non-default command line(assuming they can
do it though about://flags),
how do we know which value they use before login? We might want to include
user's hash id into the key for
retrieving color value.

> 
>
https://codereview.chromium.org/2772313004/diff/20001/components/wallpaper/pr...
> File components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc
(right):
> 
>
https://codereview.chromium.org/2772313004/diff/20001/components/wallpaper/pr...
> components/wallpaper/pref_based_wallpaper_color_cache_unittest.cc:59:
> EXPECT_FALSE(cache_.GetColor(image_1, &color));
> On 2017/03/29 01:38:08, bshe wrote:
> > On 2017/03/28 21:35:51, bruthig wrote:
> > > On 2017/03/28 21:33:26, bshe wrote:
> > > > why do you want to purge the cache? I imagine you could use it when next
> > time
> > > > the user login or when different user use the same wallpaper?
> > > 
> > > I don't plan to purge all entries in it.  Some should persist, but I don't
> > want
> > > it to grow unbounded.
> > I see. Although from the unit test, it looks like you invalidate previous
> > calculated color when a
> > new wallpaper displayed?
> 
> This test was written under the assumption the cache was initialized with a
max
> size of 1.
Got you. Thanks for explaining.

Powered by Google App Engine
This is Rietveld 408576698