another batch of lowp stages

The 4444 image in all_bitmap_configs now draws slightly different before
and after serialization.  (It's serialized as 8888.)  Still looks fine.

Change-Id: I1396cf1550b6769a1734ed25d59bd5b1866dfacd
Reviewed-on: https://skia-review.googlesource.com/65960
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Mike Klein 2017-10-31 17:31:17 -04:00 committed by Skia Commit-Bot
parent 611d48c1ed
commit 0b78a6912e
19 changed files with 10679 additions and 6755 deletions

View File

@ -678,7 +678,7 @@
"--json-output",
"/path/to/tmp/json",
"copy",
"set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-All-Android swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Release cpu_or_gpu CPU cpu_or_gpu_value Exynos5250 extra_config Android model Nexus10 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --ignoreSigInt --nogpu --config 8888 srgb serialize-8888 tiles_rt-8888 pic-8888 --src tests gm image colorImage --blacklist _ test _ GrShape serialize-8888 gm _ bleed_image serialize-8888 gm _ c_gms serialize-8888 gm _ colortype serialize-8888 gm _ colortype_xfermodes serialize-8888 gm _ drawfilter serialize-8888 gm _ fontmgr_bounds_0.75_0 serialize-8888 gm _ fontmgr_bounds_1_-0.25 serialize-8888 gm _ fontmgr_bounds serialize-8888 gm _ fontmgr_match serialize-8888 gm _ fontmgr_iter serialize-8888 gm _ imagemasksubset serialize-8888 gm _ bitmapfilters serialize-8888 gm _ bitmapshaders serialize-8888 gm _ bleed serialize-8888 gm _ bleed_alpha_bmp serialize-8888 gm _ bleed_alpha_bmp_shader serialize-8888 gm _ convex_poly_clip serialize-8888 gm _ extractalpha serialize-8888 gm _ filterbitmap_checkerboard_32_32_g8 serialize-8888 gm _ filterbitmap_image_mandrill_64 serialize-8888 gm _ shadows serialize-8888 gm _ simpleaaclip_aaclip serialize-8888 gm _ composeshader_bitmap serialize-8888 gm _ scaled_tilemodes_npot serialize-8888 gm _ scaled_tilemodes serialize-8888 gm _ typefacerendering_pfaMac serialize-8888 gm _ parsedpaths serialize-8888 gm _ ImageGeneratorExternal_rect serialize-8888 gm _ ImageGeneratorExternal_shader serialize-8888 gm _ shadow_utils serialize-8888 gm _ makecolorspace serialize-8888 gm _ bleed_alpha_image serialize-8888 gm _ bleed_alpha_image_shader serialize-8888 gm _ verylargebitmap serialize-8888 gm _ verylarge_picture_image pic-8888 gm _ drawfilter pic-8888 gm _ image-cacherator-from-picture serialize-8888 gm _ image-cacherator-from-picture pic-8888 gm _ image-cacherator-from-raster serialize-8888 gm _ image-cacherator-from-raster pic-8888 gm _ image-cacherator-from-ctable serialize-8888 gm _ image-cacherator-from-ctable pic-8888 gm _ gamut serialize-8888 gm _ gamut pic-8888 gm _ complexclip4_bw serialize-8888 gm _ complexclip4_bw pic-8888 gm _ complexclip4_aa serialize-8888 gm _ complexclip4_aa tiles_rt-8888 gm _ complexclip4_bw tiles_rt-8888 gm _ complexclip4_aa --match ~CopySurface ~SRGBReadWritePixels --verbose; echo $? >/data/local/tmp/rc",
"set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-All-Android swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Release cpu_or_gpu CPU cpu_or_gpu_value Exynos5250 extra_config Android model Nexus10 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --ignoreSigInt --nogpu --config 8888 srgb serialize-8888 tiles_rt-8888 pic-8888 --src tests gm image colorImage --blacklist _ test _ GrShape serialize-8888 gm _ bleed_image serialize-8888 gm _ c_gms serialize-8888 gm _ colortype serialize-8888 gm _ colortype_xfermodes serialize-8888 gm _ drawfilter serialize-8888 gm _ fontmgr_bounds_0.75_0 serialize-8888 gm _ fontmgr_bounds_1_-0.25 serialize-8888 gm _ fontmgr_bounds serialize-8888 gm _ fontmgr_match serialize-8888 gm _ fontmgr_iter serialize-8888 gm _ imagemasksubset serialize-8888 gm _ bitmapfilters serialize-8888 gm _ bitmapshaders serialize-8888 gm _ bleed serialize-8888 gm _ bleed_alpha_bmp serialize-8888 gm _ bleed_alpha_bmp_shader serialize-8888 gm _ convex_poly_clip serialize-8888 gm _ extractalpha serialize-8888 gm _ filterbitmap_checkerboard_32_32_g8 serialize-8888 gm _ filterbitmap_image_mandrill_64 serialize-8888 gm _ shadows serialize-8888 gm _ simpleaaclip_aaclip serialize-8888 gm _ composeshader_bitmap serialize-8888 gm _ scaled_tilemodes_npot serialize-8888 gm _ scaled_tilemodes serialize-8888 gm _ typefacerendering_pfaMac serialize-8888 gm _ parsedpaths serialize-8888 gm _ ImageGeneratorExternal_rect serialize-8888 gm _ ImageGeneratorExternal_shader serialize-8888 gm _ shadow_utils serialize-8888 gm _ all_bitmap_configs serialize-8888 gm _ makecolorspace serialize-8888 gm _ bleed_alpha_image serialize-8888 gm _ bleed_alpha_image_shader serialize-8888 gm _ verylargebitmap serialize-8888 gm _ verylarge_picture_image pic-8888 gm _ drawfilter pic-8888 gm _ image-cacherator-from-picture serialize-8888 gm _ image-cacherator-from-picture pic-8888 gm _ image-cacherator-from-raster serialize-8888 gm _ image-cacherator-from-raster pic-8888 gm _ image-cacherator-from-ctable serialize-8888 gm _ image-cacherator-from-ctable pic-8888 gm _ gamut serialize-8888 gm _ gamut pic-8888 gm _ complexclip4_bw serialize-8888 gm _ complexclip4_bw pic-8888 gm _ complexclip4_aa serialize-8888 gm _ complexclip4_aa tiles_rt-8888 gm _ complexclip4_bw tiles_rt-8888 gm _ complexclip4_aa --match ~CopySurface ~SRGBReadWritePixels --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {

View File

@ -678,7 +678,7 @@
"--json-output",
"/path/to/tmp/json",
"copy",
"set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-All-Android swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm64 compiler Clang configuration Debug cpu_or_gpu CPU cpu_or_gpu_value TegraX1 extra_config Android model PixelC os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --ignoreSigInt --nogpu --config 8888 srgb serialize-8888 tiles_rt-8888 pic-8888 --src tests gm image colorImage --gpuThreads 0 --blacklist _ test _ GrShape serialize-8888 gm _ bleed_image serialize-8888 gm _ c_gms serialize-8888 gm _ colortype serialize-8888 gm _ colortype_xfermodes serialize-8888 gm _ drawfilter serialize-8888 gm _ fontmgr_bounds_0.75_0 serialize-8888 gm _ fontmgr_bounds_1_-0.25 serialize-8888 gm _ fontmgr_bounds serialize-8888 gm _ fontmgr_match serialize-8888 gm _ fontmgr_iter serialize-8888 gm _ imagemasksubset serialize-8888 gm _ bitmapfilters serialize-8888 gm _ bitmapshaders serialize-8888 gm _ bleed serialize-8888 gm _ bleed_alpha_bmp serialize-8888 gm _ bleed_alpha_bmp_shader serialize-8888 gm _ convex_poly_clip serialize-8888 gm _ extractalpha serialize-8888 gm _ filterbitmap_checkerboard_32_32_g8 serialize-8888 gm _ filterbitmap_image_mandrill_64 serialize-8888 gm _ shadows serialize-8888 gm _ simpleaaclip_aaclip serialize-8888 gm _ composeshader_bitmap serialize-8888 gm _ scaled_tilemodes_npot serialize-8888 gm _ scaled_tilemodes serialize-8888 gm _ typefacerendering_pfaMac serialize-8888 gm _ parsedpaths serialize-8888 gm _ ImageGeneratorExternal_rect serialize-8888 gm _ ImageGeneratorExternal_shader serialize-8888 gm _ shadow_utils serialize-8888 gm _ makecolorspace serialize-8888 gm _ bleed_alpha_image serialize-8888 gm _ bleed_alpha_image_shader serialize-8888 gm _ verylargebitmap serialize-8888 gm _ verylarge_picture_image pic-8888 gm _ drawfilter pic-8888 gm _ image-cacherator-from-picture serialize-8888 gm _ image-cacherator-from-picture pic-8888 gm _ image-cacherator-from-raster serialize-8888 gm _ image-cacherator-from-raster pic-8888 gm _ image-cacherator-from-ctable serialize-8888 gm _ image-cacherator-from-ctable pic-8888 gm _ gamut serialize-8888 gm _ gamut pic-8888 gm _ complexclip4_bw serialize-8888 gm _ complexclip4_bw pic-8888 gm _ complexclip4_aa serialize-8888 gm _ complexclip4_aa tiles_rt-8888 gm _ complexclip4_bw tiles_rt-8888 gm _ complexclip4_aa --verbose; echo $? >/data/local/tmp/rc",
"set -x; /data/local/tmp/dm --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 builder Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-All-Android swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm64 compiler Clang configuration Debug cpu_or_gpu CPU cpu_or_gpu_value TegraX1 extra_config Android model PixelC os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --ignoreSigInt --nogpu --config 8888 srgb serialize-8888 tiles_rt-8888 pic-8888 --src tests gm image colorImage --gpuThreads 0 --blacklist _ test _ GrShape serialize-8888 gm _ bleed_image serialize-8888 gm _ c_gms serialize-8888 gm _ colortype serialize-8888 gm _ colortype_xfermodes serialize-8888 gm _ drawfilter serialize-8888 gm _ fontmgr_bounds_0.75_0 serialize-8888 gm _ fontmgr_bounds_1_-0.25 serialize-8888 gm _ fontmgr_bounds serialize-8888 gm _ fontmgr_match serialize-8888 gm _ fontmgr_iter serialize-8888 gm _ imagemasksubset serialize-8888 gm _ bitmapfilters serialize-8888 gm _ bitmapshaders serialize-8888 gm _ bleed serialize-8888 gm _ bleed_alpha_bmp serialize-8888 gm _ bleed_alpha_bmp_shader serialize-8888 gm _ convex_poly_clip serialize-8888 gm _ extractalpha serialize-8888 gm _ filterbitmap_checkerboard_32_32_g8 serialize-8888 gm _ filterbitmap_image_mandrill_64 serialize-8888 gm _ shadows serialize-8888 gm _ simpleaaclip_aaclip serialize-8888 gm _ composeshader_bitmap serialize-8888 gm _ scaled_tilemodes_npot serialize-8888 gm _ scaled_tilemodes serialize-8888 gm _ typefacerendering_pfaMac serialize-8888 gm _ parsedpaths serialize-8888 gm _ ImageGeneratorExternal_rect serialize-8888 gm _ ImageGeneratorExternal_shader serialize-8888 gm _ shadow_utils serialize-8888 gm _ all_bitmap_configs serialize-8888 gm _ makecolorspace serialize-8888 gm _ bleed_alpha_image serialize-8888 gm _ bleed_alpha_image_shader serialize-8888 gm _ verylargebitmap serialize-8888 gm _ verylarge_picture_image pic-8888 gm _ drawfilter pic-8888 gm _ image-cacherator-from-picture serialize-8888 gm _ image-cacherator-from-picture pic-8888 gm _ image-cacherator-from-raster serialize-8888 gm _ image-cacherator-from-raster pic-8888 gm _ image-cacherator-from-ctable serialize-8888 gm _ image-cacherator-from-ctable pic-8888 gm _ gamut serialize-8888 gm _ gamut pic-8888 gm _ complexclip4_bw serialize-8888 gm _ complexclip4_bw pic-8888 gm _ complexclip4_aa serialize-8888 gm _ complexclip4_aa tiles_rt-8888 gm _ complexclip4_bw tiles_rt-8888 gm _ complexclip4_aa --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {

View File

@ -318,6 +318,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -312,6 +312,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -384,6 +384,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -313,6 +313,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -318,6 +318,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -313,6 +313,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -382,6 +382,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -380,6 +380,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -461,6 +461,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"pic-8888",
"gm",

View File

@ -407,6 +407,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -380,6 +380,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -433,6 +433,10 @@
"serialize-8888",
"gm",
"_",
"all_bitmap_configs",
"serialize-8888",
"gm",
"_",
"makecolorspace",
"serialize-8888",
"gm",

View File

@ -403,6 +403,7 @@ def dm_flags(api, bot):
bad_serialize_gms.append('shadow_utils')
# Not expected to round trip encoding/decoding.
bad_serialize_gms.append('all_bitmap_configs')
bad_serialize_gms.append('makecolorspace')
for test in bad_serialize_gms:

View File

@ -213,8 +213,8 @@ extern "C" {
NOPE(callback)
LOWP(move_src_dst) LOWP(move_dst_src)
NOPE(clamp_0) NOPE(clamp_1) TODO(clamp_a) TODO(clamp_a_dst)
NOPE(unpremul) LOWP(premul) TODO(premul_dst)
NOPE(clamp_0) NOPE(clamp_1) LOWP(clamp_a) LOWP(clamp_a_dst)
NOPE(unpremul) LOWP(premul) LOWP(premul_dst)
LOWP(set_rgb) LOWP(swap_rb) LOWP(invert)
NOPE(from_srgb) NOPE(from_srgb_dst) NOPE(to_srgb)
LOWP(black_color) LOWP(white_color) LOWP(uniform_color)
@ -222,7 +222,7 @@ extern "C" {
LOWP(load_a8) LOWP(load_a8_dst) LOWP(store_a8) LOWP(gather_a8)
LOWP(load_g8) LOWP(load_g8_dst) LOWP(gather_g8)
LOWP(load_565) LOWP(load_565_dst) LOWP(store_565) LOWP(gather_565)
TODO(load_4444) TODO(load_4444_dst) TODO(store_4444) TODO(gather_4444)
LOWP(load_4444) LOWP(load_4444_dst) LOWP(store_4444) LOWP(gather_4444)
NOPE(load_f16) NOPE(load_f16_dst) NOPE(store_f16) NOPE(gather_f16)
NOPE(load_f32) NOPE(load_f32_dst) NOPE(store_f32)
LOWP(load_8888) LOWP(load_8888_dst) LOWP(store_8888) LOWP(gather_8888)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -260,11 +260,27 @@ STAGE_PP(set_rgb, const float rgb[3]) {
b = from_float(rgb[2]);
}
STAGE_PP(clamp_a, Ctx::None) {
r = min(r, a);
g = min(g, a);
b = min(b, a);
}
STAGE_PP(clamp_a_dst, Ctx::None) {
dr = min(dr, da);
dg = min(dg, da);
db = min(db, da);
}
STAGE_PP(premul, Ctx::None) {
r = div255(r * a);
g = div255(g * a);
b = div255(b * a);
}
STAGE_PP(premul_dst, Ctx::None) {
dr = div255(dr * da);
dg = div255(dg * da);
db = div255(db * da);
}
STAGE_PP(swap_rb, Ctx::None) {
auto tmp = r;
@ -580,6 +596,50 @@ STAGE_GP(gather_565, const SkJumper_GatherCtx* ctx) {
a = 255;
}
SI void from_4444(U16 rgba, U16* r, U16* g, U16* b, U16* a) {
// Format for 4444 buffers: 15|rrrr gggg bbbb aaaa|0.
U16 R = (rgba >> 12) & 15,
G = (rgba >> 8) & 15,
B = (rgba >> 4) & 15,
A = (rgba >> 0) & 15;
// Scale [0,15] to [0,255].
*r = (R << 4) | R;
*g = (G << 4) | G;
*b = (B << 4) | B;
*a = (A << 4) | A;
}
SI void load_4444(const uint16_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
from_4444(load<U16>(ptr, tail), r,g,b,a);
}
SI void store_4444(uint16_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
// Select the top 4 bits of each.
U16 R = r >> 4,
G = g >> 4,
B = b >> 4,
A = a >> 4;
// Pack them back into 15|rrrr gggg bbbb aaaa|0.
store(ptr, tail, R << 12
| G << 8
| B << 4
| A << 0);
}
STAGE_PP(load_4444, const SkJumper_MemoryCtx* ctx) {
load_4444(ptr_at_xy<const uint16_t>(ctx, dx,dy), tail, &r,&g,&b,&a);
}
STAGE_PP(load_4444_dst, const SkJumper_MemoryCtx* ctx) {
load_4444(ptr_at_xy<const uint16_t>(ctx, dx,dy), tail, &dr,&dg,&db,&da);
}
STAGE_PP(store_4444, const SkJumper_MemoryCtx* ctx) {
store_4444(ptr_at_xy<uint16_t>(ctx, dx,dy), tail, r,g,b,a);
}
STAGE_GP(gather_4444, const SkJumper_GatherCtx* ctx) {
const uint16_t* ptr;
U32 ix = ix_and_ptr(&ptr, ctx, x,y);
from_4444(gather<U16>(ptr, ix), &r,&g,&b,&a);
}
// ~~~~~~ 8-bit memory loads and stores ~~~~~~ //
SI U16 load_8(const uint8_t* ptr, size_t tail) {