commit-bot@chromium.org | 91a798f | 2013-09-06 15:31:06 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 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 | #include "SkShader.h" |
| 9 | #include "SkBitmap.h" |
| 10 | #include "SkRegion.h" |
| 11 | #include "SkString.h" |
| 12 | |
| 13 | class SK_API SkBitmapAlphaThresholdShader : public SkShader { |
| 14 | public: |
| 15 | /** |
| 16 | * Creates a shader that samples a bitmap and a region. If the sample is inside the region |
| 17 | * the alpha of the bitmap color is boosted up to a threshold value. If it is |
| 18 | * outside the region then the bitmap alpha is decreased to the threshold value. |
| 19 | * The 0,0 point of the region corresponds to the upper left corner of the bitmap |
| 20 | * Currently, this only has a GPU implementation, doesn't respect the paint's bitmap |
| 21 | * filter setting, and always uses clamp mode. |
| 22 | */ |
| 23 | static SkShader* Create(const SkBitmap& bitmap, const SkRegion& region, U8CPU threshold); |
| 24 | }; |