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
27
void draw(SkCanvas* canvas) {
const int w = 4;
const int h = 4;
SkColor colors[][w] = {
{ 0x00000000, 0x2a0e002a, 0x55380055, 0x7f7f007f },
{ 0x2a000e2a, 0x551c1c55, 0x7f542a7f, 0xaaaa38aa },
{ 0x55003855, 0x7f2a547f, 0xaa7171aa, 0xd4d48dd4 },
{ 0x7f007f7f, 0xaa38aaaa, 0xd48dd4d4, 0xffffffff }
};
SkDebugf("Premultiplied:\n");
for (int y = 0; y < h; ++y) {
SkDebugf("(0, %d) ", y);
for (int x = 0; x < w; ++x) {
SkDebugf("0x%08x%c", colors[y][x], x == w - 1 ? '\n' : ' ');
}
}
SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType), colors, w * 4);
SkBitmap bitmap;
bitmap.installPixels(pixmap);
SkDebugf("Unpremultiplied:\n");
for (int y = 0; y < h; ++y) {
SkDebugf("(0, %d) ", y);
for (int x = 0; x < w; ++x) {
SkDebugf("0x%08x%c", bitmap.getColor(x, y), x == w - 1 ? '\n' : ' ');
}
}
}