blob: f98387b2067dd03745ba2eb9ffaf5cc49d56ff5c [file] [log] [blame]
qiankun.miaod9aac342014-10-23 07:58:17 -07001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkMaskCache_DEFINED
9#define SkMaskCache_DEFINED
10
11#include "SkBlurTypes.h"
12#include "SkCachedData.h"
13#include "SkMask.h"
14#include "SkRect.h"
15#include "SkResourceCache.h"
16#include "SkRRect.h"
17
18class SkMaskCache {
19public:
20 /**
21 * On success, return a ref to the SkCachedData that holds the pixels, and have mask
22 * already point to that memory.
23 *
24 * On failure, return NULL.
25 */
reed4dca7a82014-10-23 12:42:46 -070026 static SkCachedData* FindAndRef(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
27 const SkRRect& rrect, SkMask* mask,
qiankun.miaod9aac342014-10-23 07:58:17 -070028 SkResourceCache* localCache = NULL);
reed4dca7a82014-10-23 12:42:46 -070029 static SkCachedData* FindAndRef(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
30 const SkRect rects[], int count, SkMask* mask,
qiankun.miaod9aac342014-10-23 07:58:17 -070031 SkResourceCache* localCache = NULL);
32
33 /**
34 * Add a mask and its pixel-data to the cache.
35 */
reed4dca7a82014-10-23 12:42:46 -070036 static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
37 const SkRRect& rrect, const SkMask& mask, SkCachedData* data,
38 SkResourceCache* localCache = NULL);
39 static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
40 const SkRect rects[], int count, const SkMask& mask, SkCachedData* data,
41 SkResourceCache* localCache = NULL);
qiankun.miaod9aac342014-10-23 07:58:17 -070042};
43
44#endif