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

Side by Side Diff: ash/app_list/icon_cache.h

Issue 10388032: Move app list from ash to ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix win_aura bot and comments in #5 Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/app_list/drop_shadow_label.cc ('k') | ash/app_list/icon_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_APP_LIST_ICON_CACHE_H_
6 #define ASH_APP_LIST_ICON_CACHE_H_
7 #pragma once
8
9 #include <map>
10 #include <string>
11
12 #include "base/basictypes.h"
13 #include "third_party/skia/include/core/SkBitmap.h"
14
15 namespace gfx {
16 class Size;
17 }
18
19 namespace ash {
20
21 // IconCache stores processed image, keyed by the source image and desired size.
22 class IconCache {
23 public:
24 static void CreateInstance();
25 static void DeleteInstance();
26
27 static IconCache* GetInstance();
28
29 void MarkAllEntryUnused();
30 void PurgeAllUnused();
31
32 bool Get(const SkBitmap& src,
33 const gfx::Size& size,
34 SkBitmap* processed);
35 void Put(const SkBitmap& src,
36 const gfx::Size& size,
37 const SkBitmap& processed);
38
39 private:
40 struct Item {
41 SkBitmap image;
42 bool used;
43 };
44 typedef std::map<std::string, Item> Cache;
45
46 IconCache();
47 ~IconCache();
48
49 static IconCache* instance_;
50
51 Cache cache_;
52
53 DISALLOW_COPY_AND_ASSIGN(IconCache);
54 };
55
56 } // namespace ash
57
58 #endif // ASH_APP_LIST_ICON_CACHE_H_
OLDNEW
« no previous file with comments | « ash/app_list/drop_shadow_label.cc ('k') | ash/app_list/icon_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698