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

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

Issue 471473002: Optimize CSS box-shadow performance (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: backed blur mask with a bitmap 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
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 "SkRect.h"
12 #include "SkRRect.h"
11 #include "SkScalar.h" 13 #include "SkScalar.h"
12 #include "SkBitmap.h" 14 #include "SkBitmap.h"
13 15
14 class SkMipMap; 16 class SkMipMap;
15 17
16 class SkBitmapCache { 18 class SkBitmapCache {
17 public: 19 public:
18 /** 20 /**
19 * Use this allocator for bitmaps, so they can use ashmem when available. 21 * Use this allocator for bitmaps, so they can use ashmem when available.
20 * Returns NULL if the ResourceCache has not been initialized with a Discard ableFactory. 22 * Returns NULL if the ResourceCache has not been initialized with a Discard ableFactory.
(...skipping 16 matching lines...) Expand all
37 * Search based on the bitmap's genID and subset. If found, returns true an d 39 * Search based on the bitmap's genID and subset. If found, returns true an d
38 * result will be set to the matching bitmap with its pixels already locked . 40 * result will be set to the matching bitmap with its pixels already locked .
39 */ 41 */
40 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result); 42 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result);
41 43
42 /** 44 /**
43 * The width and the height of the provided subset must be the same as the r esult bitmap ones. 45 * The width and the height of the provided subset must be the same as the r esult bitmap ones.
44 * result must be marked isImmutable() 46 * result must be marked isImmutable()
45 */ 47 */
46 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul t); 48 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul t);
49
50 static bool Find(SkScalar sigma, const SkRRect& rrect, SkBitmap* result);
51 static void Add(SkScalar sigma, const SkRRect& rrect, const SkBitmap& result );
52
53 static bool Find(SkScalar sigma, int32_t count, const SkRect rects[], SkBitm ap* result);
54 static void Add(SkScalar sigma, int32_t count, const SkRect rects[], const S kBitmap& result);
47 }; 55 };
48 56
49 class SkMipMapCache { 57 class SkMipMapCache {
50 public: 58 public:
51 static const SkMipMap* FindAndRef(const SkBitmap& src); 59 static const SkMipMap* FindAndRef(const SkBitmap& src);
52 static void Add(const SkBitmap& src, const SkMipMap* result); 60 static void Add(const SkBitmap& src, const SkMipMap* result);
53 }; 61 };
54 62
55 #endif 63 #endif
OLDNEW
« no previous file with comments | « include/core/SkMask.h ('k') | src/core/SkBitmapCache.cpp » ('j') | src/core/SkBitmapCache.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698