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

Side by Side Diff: src/core/SkBitmapCache.h

Issue 507483002: retool image cache to be generic cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkBitmapCache_DEFINED 8 #ifndef SkBitmapCache_DEFINED
9 #define SkBitmapCache_DEFINED 9 #define SkBitmapCache_DEFINED
10 10
11 #include "SkScaledImageCache.h" 11 #include "SkScaledImageCache.h"
Stephen White 2014/08/26 14:25:08 Not new to this patch, but I'm a little confused b
reed1 2014/08/26 14:45:02 BitmapCache is a specialization of our (yet to be
12 12
13 class SkBitmapCache { 13 class SkBitmapCache {
14 public: 14 public:
15 typedef SkScaledImageCache::ID ID; 15 typedef SkScaledImageCache::ID ID;
16 16
17 static void Unlock(ID* id) {
18 SkScaledImageCache::Unlock(id);
19 }
20
21 /* Input: bitmap+inverse_scale */ 17 /* Input: bitmap+inverse_scale */
22 static ID* FindAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar inv ScaleY, 18 static ID FindAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar invS caleY,
23 SkBitmap* result); 19 SkBitmap* result);
24 static ID* AddAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar invS caleY, 20 static ID AddAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar invSc aleY,
25 const SkBitmap& result); 21 const SkBitmap& result);
26 22
27 /* Input: bitmap_genID+width+height */ 23 /* Input: bitmap_genID+width+height */
28 static ID* FindAndLock(uint32_t genID, int width, int height, SkBitmap* resu lt); 24 static ID FindAndLock(uint32_t genID, int width, int height, SkBitmap* resul t);
29 25
30 static ID* AddAndLock(uint32_t genID, int width, int height, const SkBitmap& result); 26 static ID AddAndLock(uint32_t genID, int width, int height, const SkBitmap& result);
31 }; 27 };
32 28
33 class SkMipMapCache { 29 class SkMipMapCache {
34 public: 30 public:
35 typedef SkScaledImageCache::ID ID; 31 typedef SkScaledImageCache::ID ID;
36 32
37 static void Unlock(ID* id) { 33 static ID FindAndLock(const SkBitmap& src, const SkMipMap** result);
38 SkScaledImageCache::Unlock(id); 34 static ID AddAndLock(const SkBitmap& src, const SkMipMap* result);
39 }
40
41 static ID* FindAndLock(const SkBitmap& src, const SkMipMap** result);
42 static ID* AddAndLock(const SkBitmap& src, const SkMipMap* result);
43 }; 35 };
44 36
45 #endif 37 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698