diff options
author | 2013-09-06 15:31:06 +0000 | |
---|---|---|
committer | 2013-09-06 15:31:06 +0000 | |
commit | 91a798f121a2238639f8e2d08cc776d4f0236ceb (patch) | |
tree | 2eb3f173e69d21f3a39165f9b835643f8365e383 /include/effects/SkBitmapAlphaThresholdShader.h | |
parent | 04c500fd756053e3fe8e278a253b5ad618742d50 (diff) |
alpha threshold bitmap shader
Committed: http://code.google.com/p/skia/source/detail?r=11122
R=reed@google.com
Author: bsalomon@google.com
Review URL: https://chromiumcodereview.appspot.com/23707019
git-svn-id: http://skia.googlecode.com/svn/trunk@11131 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects/SkBitmapAlphaThresholdShader.h')
-rw-r--r-- | include/effects/SkBitmapAlphaThresholdShader.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/effects/SkBitmapAlphaThresholdShader.h b/include/effects/SkBitmapAlphaThresholdShader.h new file mode 100644 index 0000000000..61596daff3 --- /dev/null +++ b/include/effects/SkBitmapAlphaThresholdShader.h @@ -0,0 +1,24 @@ +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkShader.h" +#include "SkBitmap.h" +#include "SkRegion.h" +#include "SkString.h" + +class SK_API SkBitmapAlphaThresholdShader : public SkShader { +public: + /** + * Creates a shader that samples a bitmap and a region. If the sample is inside the region + * the alpha of the bitmap color is boosted up to a threshold value. If it is + * outside the region then the bitmap alpha is decreased to the threshold value. + * The 0,0 point of the region corresponds to the upper left corner of the bitmap + * Currently, this only has a GPU implementation, doesn't respect the paint's bitmap + * filter setting, and always uses clamp mode. + */ + static SkShader* Create(const SkBitmap& bitmap, const SkRegion& region, U8CPU threshold); +}; |