blob: 61596daff3e0bc0bcf8204ce1563f6ae18897360 [file] [log] [blame]
commit-bot@chromium.org91a798f2013-09-06 15:31:06 +00001/*
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
13class SK_API SkBitmapAlphaThresholdShader : public SkShader {
14public:
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};