29 "mask",
"rect",
"sprite",
44 if (fType == kSprite) {
50 const char*
text =
"Hamburgefons";
51 size_t len = strlen(
text);
56 paint.setBlendMode(fBlendMode);
66 int iterations = std::min(1000, loops);
67 for (
int j = 0; j < iterations; ++j) {
82 int iterations = std::min(1000, loops);
83 for (
int j = 0; j < iterations; ++j) {
89 paint.setAlphaf(1.0f);
90 for (
int i = 0; i < 10; ++i) {
111 DEF_BENCH( return new XfermodeBench(mode, kText); ) \
112 DEF_BENCH( return new XfermodeBench(mode, kRect); ) \
113 DEF_BENCH( return new XfermodeBench(mode, kSprite); )
const char * gTypeNames[]
SK_API const char * SkBlendMode_Name(SkBlendMode blendMode)
@ kExclusion
rc = s + d - two(s*d), ra = kSrcOver
@ kSaturation
saturation of source with hue and luminosity of destination
@ kColorBurn
darken destination to reflect source
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kHue
hue of source with saturation and luminosity of destination
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kColorDodge
brighten destination to reflect source
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ kLuminosity
luminosity of source with hue and saturation of destination
@ kSoftLight
lighten or darken, depending on source
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
@ kOverlay
multiply or screen, depending on destination
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
@ kColor
hue and saturation of source with luminosity of destination
@ kHardLight
multiply or screen, depending on source
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void drawRect(const SkRect &rect, const SkPaint &paint)
virtual SkISize getBaseLayerSize() const
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
SkScalar nextRangeScalar(SkScalar min, SkScalar max)
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
void onDelayedSetup() override
XfermodeBench(SkBlendMode mode, Type t)
void onDraw(int loops, SkCanvas *canvas) override
const char * onGetName() override
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)