Options
These globals are now defined:
double duration; // The requested duration of the animation. double frame; // A value in [0, 1] of where we are in the animation.
This global is now defined:
GrBackendRenderTarget backEndRenderTarget;
GrBackendTexture backEndTextureRenderTarget;
Optional source image
These globals are now defined:
SkBitmap source; sk_sp<SkImage> image; GrBackendTexture backEndTexture; // GPU Only.
Note:
Adding comments with SK_FOLD_START and SK_FOLD_END creates foldable code
blocks.
These blocks will be folded by default and are useful for highlighting specific lines of code.
You can also use the keyboard shortcuts Ctrl+S and Ctrl+E in the code editor to set them.
These blocks will be folded by default and are useful for highlighting specific lines of code.
You can also use the keyboard shortcuts Ctrl+S and Ctrl+E in the code editor to set them.
xxxxxxxxxx
29
void draw(SkCanvas* canvas) {
const SkScalar blurSigma = 3.4f;
const SkColor blurColor = SkColorSetRGB(96, 96, 0);
const uint8_t blurAlpha = 127;
const SkScalar xDrop = 5.0f;
const SkScalar yDrop = 5.0f;
const char text[] = "Skia";
const SkScalar x = 0.0f;
const SkScalar y = 160.0f;
canvas->drawColor(SK_ColorWHITE);
SkPaint paint;
paint.setAntiAlias(true);
SkPaint blur(paint);
blur.setColor(blurColor);
blur.setAlpha(blurAlpha);
blur.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, blurSigma, false));
SkFont font(fontMgr->matchFamilyStyle(nullptr, {}), 120);
// Draw once with drop shadow blur;
canvas->drawString(text, x + xDrop, y + yDrop, font, blur);
// Overdraw with with no blur mask
canvas->drawString(text, x, y, font, paint);
}