Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkBlurMask_DEFINED | 8 #ifndef SkBlurMask_DEFINED |
| 9 #define SkBlurMask_DEFINED | 9 #define SkBlurMask_DEFINED |
| 10 #include <map> | |
| 10 | 11 |
| 11 #include "SkBlurTypes.h" | 12 #include "SkBlurTypes.h" |
| 12 #include "SkShader.h" | 13 #include "SkShader.h" |
| 13 #include "SkMask.h" | 14 #include "SkMask.h" |
| 14 #include "SkRRect.h" | 15 #include "SkRRect.h" |
| 15 | 16 |
| 16 class SkBlurMask { | 17 class SkBlurMask { |
| 17 public: | 18 public: |
| 18 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, SkBlurS tyle, | 19 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, SkBlurS tyle, |
| 19 SkIPoint *margin = NULL, | 20 SkIPoint *margin = NULL, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 will produce both the horizontal and vertical profiles of the blurry rec tangle. | 69 will produce both the horizontal and vertical profiles of the blurry rec tangle. |
| 69 @param pixels Location to store the resulting pixel data; allocated and managed by caller | 70 @param pixels Location to store the resulting pixel data; allocated and managed by caller |
| 70 @param profile Precomputed blur profile computed by ComputeBlurProfile a bove. | 71 @param profile Precomputed blur profile computed by ComputeBlurProfile a bove. |
| 71 @param width Size of the pixels array. | 72 @param width Size of the pixels array. |
| 72 @param sigma Standard deviation of the gaussian blur kernel used to comp ute the profile; | 73 @param sigma Standard deviation of the gaussian blur kernel used to comp ute the profile; |
| 73 this implicitly gives the size of the pixels array. | 74 this implicitly gives the size of the pixels array. |
| 74 */ | 75 */ |
| 75 | 76 |
| 76 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, | 77 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, |
| 77 unsigned int width, SkScalar sigma); | 78 unsigned int width, SkScalar sigma); |
| 79 static bool addDiscardableMemoryMaskToMap(SkMask*, SkDiscardableMemoryMask*) ; | |
| 80 static bool removeDiscardableMemoryMaskFromMap(SkMask*); | |
| 81 static SkDiscardableMemoryMask* getDiscardableMemoryMaskFromMap(SkMask*); | |
|
Stephen White
2014/06/09 18:03:57
Naming nit: similarly, could this be getCachedMask
| |
| 78 | 82 |
| 79 | 83 private: |
| 84 static std::map<SkMask*, SkDiscardableMemoryMask*> fDiscardableMemoryMaskMap ; | |
| 80 | 85 |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 #endif | 88 #endif |
| OLD | NEW |