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

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

Issue 518983002: The key for SkBitmapCache can now be genID+SkIRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add checks on SkBitmapCache::Add Created 6 years, 3 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
« no previous file with comments | « no previous file | src/core/SkBitmapCache.cpp » ('j') | src/core/SkBitmapCache.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 13 matching lines...) Expand all
24 /** 24 /**
25 * Search based on the src bitmap and inverse scales in X and Y. If found, returns true and 25 * Search based on the src bitmap and inverse scales in X and Y. If found, returns true and
26 * result will be set to the matching bitmap with its pixels already locked . 26 * result will be set to the matching bitmap with its pixels already locked .
27 */ 27 */
28 static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY , SkBitmap* result); 28 static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY , SkBitmap* result);
29 29
30 /* 30 /*
31 * result must be marked isImmutable() 31 * result must be marked isImmutable()
32 */ 32 */
33 static void Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, 33 static void Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY,
34 const SkBitmap& result); 34 const SkBitmap& result);
35 35
36 /** 36 /**
37 * Search based on the bitmap's genID, width, height. If found, returns tru e and 37 * Search based on the bitmap's genID, width, height. If found, returns tru e and
38 * result will be set to the matching bitmap with its pixels already locked . 38 * result will be set to the matching bitmap with its pixels already locked .
39 */ 39 */
40 static bool Find(uint32_t genID, int width, int height, SkBitmap* result); 40 static bool Find(uint32_t genID, int width, int height, SkBitmap* result);
41 41
42 /* 42 /**
43 * result must be marked isImmutable() 43 * The width and the height provided for the key must be the same as the res ult bitmap ones.
44 *
45 * result must be marked isImmutable()
44 */ 46 */
45 static void Add(uint32_t genID, int width, int height, const SkBitmap& resul t); 47 static bool Add(uint32_t genID, int width, int height, const SkBitmap& resul t);
48
49 /**
50 * Search based on the bitmap's genID and subset. If found, returns true an d
51 * result will be set to the matching bitmap with its pixels already locked .
52 */
53 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result);
54
55 /**
56 * The width and the height of the provided subset must be the same as the r esult bitmap ones.
57 * result must be marked isImmutable()
58 */
59 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul t);
46 }; 60 };
47 61
48 class SkMipMapCache { 62 class SkMipMapCache {
49 public: 63 public:
50 static const SkMipMap* FindAndRef(const SkBitmap& src); 64 static const SkMipMap* FindAndRef(const SkBitmap& src);
51 static void Add(const SkBitmap& src, const SkMipMap* result); 65 static void Add(const SkBitmap& src, const SkMipMap* result);
52 }; 66 };
53 67
54 #endif 68 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkBitmapCache.cpp » ('j') | src/core/SkBitmapCache.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698