| OLD | NEW |
| (Empty) |
| 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 ins
ide the region | |
| 17 * the alpha of the bitmap color is boosted up to a threshold value. If it i
s | |
| 18 * outside the region then the bitmap alpha is decreased to the threshold va
lue. | |
| 19 * The 0,0 point of the region corresponds to the upper left corner of the b
itmap | |
| 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, U8CP
U threshold); | |
| 24 }; | |
| OLD | NEW |