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
32
const char* color_type(SkColorType ct) {
switch (ct) {
case kUnknown_SkColorType: return "Unknown";
case kAlpha_8_SkColorType: return "Alpha_8";
case kRGB_565_SkColorType: return "RGB_565";
case kARGB_4444_SkColorType: return "ARGB_4444";
case kRGBA_8888_SkColorType: return "RGBA_8888";
case kRGB_888x_SkColorType: return "RGB_888x";
case kBGRA_8888_SkColorType: return "BGRA_8888";
case kRGBA_1010102_SkColorType: return "RGBA_1010102";
case kRGB_101010x_SkColorType: return "RGB_101010x";
case kGray_8_SkColorType: return "Gray_8";
case kRGBA_F16Norm_SkColorType: return "RGBA_F16Norm";
case kRGBA_F16_SkColorType: return "RGBA_F16";
case kRGB_F16F16F16x_SkColorType: return "RGB_F16F16F16x";
case kRGBA_F32_SkColorType: return "RGBA_F32";
default: SkASSERT(false); return nullptr;
}
}
void draw(SkCanvas* canvas) {
for (SkColorType colorType : {
kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType,
kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kRGB_888x_SkColorType,
kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType,
kGray_8_SkColorType, kRGBA_F16_SkColorType, kRGB_F16F16F16x_SkColorType
} ) {
SkImageInfo info = SkImageInfo::Make(1, 1, colorType, kOpaque_SkAlphaType);
SkDebugf("color: k" "%s" "_SkColorType" "%*s" "shiftPerPixel: %d\n",
color_type(colorType), (int)(14 - strlen(color_type(colorType))), " ",
info.shiftPerPixel());
}
}