Thanks for the quick feedback. Yes. we used the kGray_8_SkColorType.
Now, I just swap to kAlpha_8_SkColorType and compose the existing same colour filter with another filter created by "SkColorFilters::Blend(SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF), SkBlendMode::kSrcIn)",
then both color and transparency for each pixel works as we expected but I can't understand why need to compose another special filter. would you please help to clarify my workaround?
Here is sample code,
auto imageInfo = SkImageInfo::Make(pixelMemory->Width(), pixelMemory->Height(), kAlpha_8_SkColorType, kPremul_SkAlphaType);
auto composedFilter = SkColorFilters::Compose(filter, SkColorFilters::Blend(SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF), SkBlendMode::kSrcIn));
paint.setColorFilter(composedFilter);
bitmap.installPixels(...);
canvas->drawImage(bitmap.asImage(), x, y, SkSamplingOptions{}, &paint);
Thanks much,
Levin