Chromium Code Reviews| Index: src/core/SkMaskCache.h |
| diff --git a/src/core/SkMaskCache.h b/src/core/SkMaskCache.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b7d2aa166f6dbf7e9e10c141e6f91fd5824a1a13 |
| --- /dev/null |
| +++ b/src/core/SkMaskCache.h |
| @@ -0,0 +1,42 @@ |
| +/* |
| + * Copyright 2014 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef SkMaskCache_DEFINED |
| +#define SkMaskCache_DEFINED |
| + |
| +#include "SkCachedData.h" |
| +#include "SkMask.h" |
| +#include "SkRect.h" |
| +#include "SkResourceCache.h" |
| +#include "SkRRect.h" |
| + |
| +class SkMaskCache { |
| +public: |
| + /** |
| + * On success, return a ref to the SkCachedData that holds the pixels, and have mask |
| + * already point to that memory. |
| + * |
| + * On failure, return NULL. |
| + */ |
| + static SkCachedData* FindAndRef(SkScalar sigma, const SkRRect& rrect, |
| + SkMask* mask, SkResourceCache* localCache = NULL); |
| + static SkCachedData* FindAndRef(SkScalar sigma, const SkRect rects[], |
| + int32_t count, SkMask* mask, |
|
reed1
2014/10/22 13:36:20
nit: skia just uses "int" for counts.
|
| + SkResourceCache* localCache = NULL); |
| + |
| + /** |
| + * Add a mask and its pixel-data to the cache. |
| + */ |
| + static void Add(SkScalar sigma, const SkRRect& rrect, |
| + const SkMask& mask, SkCachedData* data, |
| + SkResourceCache* localCache = NULL); |
| + static void Add(SkScalar sigma, const SkRect rects[], int32_t count, |
| + const SkMask& mask, SkCachedData* data, |
| + SkResourceCache* localCache = NULL); |
| +}; |
| + |
| +#endif |