Refactor GrCaps::renderTargetWritePixelsSupported to support for some GL workarounds

Make indirect path in writeSurfacePixels2 use a copy rather than a draw.

Fix issue in GrVkGpu where render target dirty region is not updated after copy-as-draw

Remove unnecessary resolve of MSAA RT in GrVkCopyManager.

Splits WritePixelsNonTexture_Gpu test into MSAA and non-MSAA variants. MSAA variant blacklisted
on Adreno because of:

Bug: skia:7663

~~~~~~AND~~~~~~~

Revert "Suppress CopySurface test on Nexus 7"

This reverts commit b42b6169d5.

Bug: skia:7658
Change-Id: I8337d718efb41e266537744bbf5ff8b1545322a7
Reviewed-on: https://skia-review.googlesource.com/110700
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2018-02-27 16:46:11 -05:00 committed by Skia Commit-Bot
parent e5b7ceeac8
commit 3d86a19f42
22 changed files with 98 additions and 74 deletions

View File

@ -20,6 +20,7 @@ class GrBackendRenderTarget;
class GrBackendTexture;
struct GrContextOptions;
class GrRenderTargetProxy;
class GrSurface;
class SkJSONWriter;
/**
@ -186,12 +187,11 @@ public:
}
/**
* Some backends have restrictions on what types of render targets for which
* GrGpu::writePixels() will succeed. If this returns false then the caller should implement a
* fallback where a temporary texture is created, pixels are written to it, and then that is
* copied or drawn into the the render target.
* Backends may have restrictions on what types of surfaces support GrGpu::writePixels().
* If this returns false then the caller should implement a fallback where a temporary texture
* is created, pixels are written to it, and then that is copied or drawn into the the surface.
*/
virtual bool renderTargetWritePixelsSupported(bool isAlsoTexture, int sampleCnt) const = 0;
virtual bool surfaceSupportsWritePixels(const GrSurface* surface) const = 0;
/**
* Given a dst pixel config and a src color type what color type must the caller coax the

View File

@ -70,9 +70,6 @@ struct GrContextOptions {
*/
SkExecutor* fExecutor = nullptr;
/** some gpus have problems with partial writes of the rendertarget */
bool fUseDrawInsteadOfPartialRenderTargetWrite = false;
/** Construct mipmaps manually, via repeated downsampling draw-calls. This is used when
the driver's implementation (glGenerateMipmap) contains bugs. This requires mipmap
level and LOD control (ie desktop or ES3). */

View File

@ -722,7 +722,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-Nexus7-CPU-Tegra3-arm-Release-All-Android buildbucket_build_id 123454321 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 Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --threads 2 --nogpu --config 8888 srgb serialize-8888 tiles_rt-8888 pic-8888 --src tests gm image colorImage --blacklist _ test _ CopySurface _ 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 _ analytic_antialias_convex 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 --nonativeFonts --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-Nexus7-CPU-Tegra3-arm-Release-All-Android buildbucket_build_id 123454321 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 Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --threads 2 --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 _ analytic_antialias_convex 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 --nonativeFonts --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {

View File

@ -722,7 +722,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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ CopySurface _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id skia-bot-123 swarming_task_id 123456 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {

View File

@ -870,7 +870,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-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan buildbucket_build_id 123454321 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 GPU cpu_or_gpu_value Adreno530 extra_config Android_Vulkan model Pixel os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config vk --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --match ~CopySurface --nonativeFonts --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-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan buildbucket_build_id 123454321 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 GPU cpu_or_gpu_value Adreno530 extra_config Android_Vulkan model Pixel os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config vk --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --match ~CopySurface ~WritePixelsNonTextureMSAA_Gpu ~WritePixelsMSAA_Gpu --nonativeFonts --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {

View File

@ -390,7 +390,9 @@
"~^SRGBReadWritePixels$",
"~^VkUploadPixelsTests$",
"~^WritePixelsNonTexture_Gpu$",
"~^WritePixelsNonTextureMSAA_Gpu$",
"~^WritePixels_Gpu$",
"~^WritePixelsMSAA_Gpu$",
"~^skbug6653$",
"--nonativeFonts",
"--verbose"

View File

@ -606,7 +606,9 @@
"~SpecialImage_DeferredGpu",
"~SpecialImage_Gpu",
"~WritePixels_Gpu",
"~WritePixelsMSAA_Gpu",
"~WritePixelsNonTexture_Gpu",
"~WritePixelsNonTextureMSAA_Gpu",
"~XfermodeImageFilterCroppedInput_Gpu",
"~GrDefaultPathRendererTest",
"~GrMSAAPathRendererTest",

View File

@ -724,7 +724,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-Nexus7-GPU-Tegra3-arm-Release-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Release cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ CopySurface _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --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-Nexus7-GPU-Tegra3-arm-Release-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Release cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {

View File

@ -722,7 +722,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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ CopySurface _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ CopySurface _ test _ GrShape _ test _ WritePixelsNonTexture_Gpu _ test _ WritePixels_Gpu _ test _ GrSurfaceRenderability _ test _ ES2BlendWithNoTexture _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ test _ WritePixelsNonTexture_Gpu _ test _ WritePixelsNonTextureMSAA_Gpu _ test _ WritePixels_Gpu _ test _ WritePixelsMSAA_Gpu _ test _ GrSurfaceRenderability _ test _ ES2BlendWithNoTexture _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ CopySurface _ test _ GrShape _ test _ SRGBReadWritePixels _ test _ SRGBMipMap _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --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-Nexus7-GPU-Tegra3-arm-Debug-All-Android buildbucket_build_id 123454321 swarming_bot_id \"\" swarming_task_id \"\" --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Debug cpu_or_gpu GPU cpu_or_gpu_value Tegra3 extra_config Android model Nexus7 os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --dont_write pdf --nocpu --config gles glesdft --src tests gm image colorImage svg --blacklist _ svg _ svgparse_ _ test _ GrShape _ test _ SRGBReadWritePixels _ test _ SRGBMipMap _ image _ interlaced1.png _ image _ interlaced2.png _ image _ interlaced3.png _ image _ .arw _ image _ .cr2 _ image _ .dng _ image _ .nef _ image _ .nrw _ image _ .orf _ image _ .raf _ image _ .rw2 _ image _ .pef _ image _ .srw _ image _ .ARW _ image _ .CR2 _ image _ .DNG _ image _ .NEF _ image _ .NRW _ image _ .ORF _ image _ .RAF _ image _ .RW2 _ image _ .PEF _ image _ .SRW --nonativeFonts --verbose; echo $? >/data/local/tmp/rc",
"[START_DIR]/tmp/dm.sh"
],
"env": {

View File

@ -342,10 +342,6 @@ def dm_flags(api, bot):
blacklist('_ image gen_platf rle8-height-negative.bmp')
blacklist('_ image gen_platf rle4-height-negative.bmp')
if 'Nexus7' in bot:
# skia:7658. This test fails on Nexus 7.
blacklist('_ test _ CopySurface')
if 'Android' in bot or 'iOS' in bot or 'Chromecast' in bot:
# This test crashes the N9 (perhaps because of large malloc/frees). It also
# is fairly slow and not platform-specific. So we just disable it on all of
@ -355,7 +351,9 @@ def dm_flags(api, bot):
if api.vars.internal_hardware_label == 1:
# skia:7046
blacklist('_ test _ WritePixelsNonTexture_Gpu')
blacklist('_ test _ WritePixelsNonTextureMSAA_Gpu')
blacklist('_ test _ WritePixels_Gpu')
blacklist('_ test _ WritePixelsMSAA_Gpu')
blacklist('_ test _ GrSurfaceRenderability')
blacklist('_ test _ ES2BlendWithNoTexture')
@ -565,6 +563,11 @@ def dm_flags(api, bot):
# skia:5777
match.extend(['~CopySurface'])
if 'Vulkan' in bot and 'Adreno' in bot:
# skia:7663
match.extend(['~WritePixelsNonTextureMSAA_Gpu'])
match.extend(['~WritePixelsMSAA_Gpu'])
if 'Vulkan' in bot and 'NexusPlayer' in bot:
# skia:6132
match.append('~^tilemodes$')
@ -606,7 +609,9 @@ def dm_flags(api, bot):
match.append('~^SRGBReadWritePixels$')
match.append('~^VkUploadPixelsTests$')
match.append('~^WritePixelsNonTexture_Gpu$')
match.append('~^WritePixelsNonTextureMSAA_Gpu$')
match.append('~^WritePixels_Gpu$')
match.append('~^WritePixelsMSAA_Gpu$')
match.append('~^skbug6653$')
if 'Vulkan' in bot and 'IntelIris540' in bot and 'Win' in bot:
@ -679,7 +684,9 @@ def dm_flags(api, bot):
match.append('~SpecialImage_DeferredGpu')
match.append('~SpecialImage_Gpu')
match.append('~WritePixels_Gpu')
match.append('~WritePixelsMSAA_Gpu')
match.append('~WritePixelsNonTexture_Gpu')
match.append('~WritePixelsNonTextureMSAA_Gpu')
match.append('~XfermodeImageFilterCroppedInput_Gpu')
match.append('~GrDefaultPathRendererTest') #skia:7244
match.append('~GrMSAAPathRendererTest') #skia:7244

View File

@ -1054,10 +1054,7 @@ bool GrContextPriv::writeSurfacePixels2(GrSurfaceContext* dst, int left, int top
return false;
}
auto dstRTProxy = dstProxy->asRenderTargetProxy();
if (dstRTProxy &&
!fContext->caps()->renderTargetWritePixelsSupported(SkToBool(dstProxy->asTextureProxy()),
dstRTProxy->numColorSamples())) {
if (!fContext->caps()->surfaceSupportsWritePixels(dstSurface)) {
GrSurfaceDesc desc;
desc.fConfig = dstProxy->config();
desc.fWidth = width;
@ -1078,14 +1075,7 @@ bool GrContextPriv::writeSurfacePixels2(GrSurfaceContext* dst, int left, int top
srcColorSpace, buffer, rowBytes, pixelOpsFlags)) {
return false;
}
GrPaint paint;
paint.setAllowSRGBInputs(true);
paint.addColorTextureProcessor(std::move(tempProxy), SkMatrix::I());
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
dst->asRenderTargetContext()->drawRect(GrNoClip(), std::move(paint), GrAA::kNo,
SkMatrix::MakeTrans(left, top),
SkRect::MakeIWH(width, height));
return true;
return dst->copy(tempProxy.get(), SkIRect::MakeWH(width, height), {left, top});
}
// TODO: Make GrSurfaceContext know its alpha type and pass src buffer's alpha type.

View File

@ -2391,9 +2391,6 @@ void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {
SkASSERT(!fUseDrawInsteadOfAllRenderTargetWrites);
SkASSERT(!fRequiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines);
}
if (options.fUseDrawInsteadOfPartialRenderTargetWrite) {
fUseDrawInsteadOfAllRenderTargetWrites = true;
}
if (GrContextOptions::Enable::kNo == options.fUseDrawInsteadOfGLClear) {
fUseDrawToClearColor = false;
} else if (GrContextOptions::Enable::kYes == options.fUseDrawInsteadOfGLClear) {
@ -2404,6 +2401,26 @@ void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {
}
}
bool GrGLCaps::surfaceSupportsWritePixels(const GrSurface* surface) const {
if (fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO) {
if (auto tex = static_cast<const GrGLTexture*>(surface->asTexture())) {
if (tex->hasBaseLevelBeenBoundToFBO()) {
return false;
}
}
}
if (auto rt = surface->asRenderTarget()) {
if (fUseDrawInsteadOfAllRenderTargetWrites) {
return false;
}
if (rt->numColorSamples() > 1 && this->usesMSAARenderBuffers()) {
return false;
}
return SkToBool(surface->asTexture());
}
return true;
}
bool GrGLCaps::onIsMixedSamplesSupportedForRT(const GrBackendRenderTarget& backendRT) const {
const GrGLFramebufferInfo* fbInfo = backendRT.getGLFramebufferInfo();
SkASSERT(fbInfo);

View File

@ -316,12 +316,7 @@ public:
/// Use indices or vertices in CPU arrays rather than VBOs for dynamic content.
bool useNonVBOVertexAndIndexDynamicData() const { return fUseNonVBOVertexAndIndexDynamicData; }
bool renderTargetWritePixelsSupported(bool isAlsoTexture, int sampleCnt) const override {
if (sampleCnt > 1 && this->usesMSAARenderBuffers()) {
return false;
}
return isAlsoTexture;
}
bool surfaceSupportsWritePixels(const GrSurface* surface) const override;
/// Does ReadPixels support reading readConfig pixels from a FBO that is surfaceConfig?
bool readPixelsSupported(GrPixelConfig surfaceConfig,

View File

@ -3462,6 +3462,7 @@ bool GrGLGpu::onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin,
return false;
}
// Don't prefer copying as a draw if the dst doesn't already have a FBO object.
// This implicitly handles this->glCaps().useDrawInsteadOfAllRenderTargetWrites().
bool preferCopy = SkToBool(dst->asRenderTarget());
if (preferCopy && src->asTexture()) {
if (this->copySurfaceAsDraw(dst, dstOrigin, src, srcOrigin, srcRect, dstPoint)) {

View File

@ -67,9 +67,7 @@ public:
return 0;
}
bool renderTargetWritePixelsSupported(bool isAlsoTexture, int sampleCnt) const override {
return true;
}
bool surfaceSupportsWritePixels(const GrSurface* surface) const override { return true; }
bool initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc* desc,
bool* rectsMustMatch, bool* disallowSubrect) const override {

View File

@ -31,9 +31,7 @@ public:
int getRenderTargetSampleCount(int requestedCount, GrPixelConfig) const override;
int maxRenderTargetSampleCount(GrPixelConfig) const override;
bool renderTargetWritePixelsSupported(bool isAlsoTexture, int sampleCnt) const override {
return true;
}
bool surfaceSupportsWritePixels(const GrSurface* surface) const override { return true; }
bool isConfigCopyable(GrPixelConfig config) const override {
return true;

View File

@ -6,9 +6,9 @@
*/
#include "GrVkCaps.h"
#include "GrBackendSurface.h"
#include "GrRenderTargetProxy.h"
#include "GrRenderTarget.h"
#include "GrShaderCaps.h"
#include "GrVkUtil.h"
#include "vk/GrVkBackendContext.h"
@ -429,6 +429,13 @@ int GrVkCaps::maxRenderTargetSampleCount(GrPixelConfig config) const {
return table[table.count() - 1];
}
bool GrVkCaps::surfaceSupportsWritePixels(const GrSurface* surface) const {
if (auto rt = surface->asRenderTarget()) {
return rt->numColorSamples() <= 1 && SkToBool(surface->asTexture());
}
return true;
}
bool validate_image_info(VkFormat format, SkColorType ct, GrPixelConfig* config) {
*config = kUnknown_GrPixelConfig;

View File

@ -40,9 +40,7 @@ public:
int getRenderTargetSampleCount(int requestedCount, GrPixelConfig config) const override;
int maxRenderTargetSampleCount(GrPixelConfig config) const override;
bool renderTargetWritePixelsSupported(bool isAlsoTexture, int sampleCnt) const override {
return sampleCnt <= 1 && isAlsoTexture;
}
bool surfaceSupportsWritePixels(const GrSurface* surface) const override;
bool isConfigTexturableLinearly(GrPixelConfig config) const {
return SkToBool(ConfigInfo::kTextureable_Flag & fConfigTable[config].fLinearFlags);

View File

@ -1845,6 +1845,8 @@ bool GrVkGpu::onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin,
}
if (fCopyManager.copySurfaceAsDraw(this, dst, dstOrigin, src, srcOrigin, srcRect, dstPoint)) {
auto dstRect = srcRect.makeOffset(dstPoint.fX, dstPoint.fY);
this->didWriteToSurface(dst, dstOrigin, &dstRect);
return true;
}

View File

@ -398,29 +398,32 @@ DEF_TEST(WritePixels, reporter) {
}
}
#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixels_Gpu, reporter, ctxInfo) {
static void test_write_pixels(skiatest::Reporter* reporter, GrContext* context, int sampleCnt) {
const SkImageInfo ii = SkImageInfo::MakeN32Premul(DEV_W, DEV_H);
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
for (int sampleCnt : {1, 4}) {
sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(),
sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(context,
SkBudgeted::kNo, ii, sampleCnt,
origin, nullptr));
if (!surface && sampleCnt > 1) {
// Some platforms don't support MSAA
if (surface) {
continue;
}
test_write_pixels(reporter, surface.get());
}
}
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsNonTexture_Gpu, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixels_Gpu, reporter, ctxInfo) {
test_write_pixels(reporter, ctxInfo.grContext(), 1);
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsMSAA_Gpu, reporter, ctxInfo) {
test_write_pixels(reporter, ctxInfo.grContext(), 1);
}
static void test_write_pixels_non_texture(skiatest::Reporter* reporter, GrContext* context,
int sampleCnt) {
GrGpu* gpu = context->contextPriv().getGpu();
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
for (int sampleCnt : {1, 4}) {
GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
nullptr, DEV_W, DEV_H, kSkia8888_GrPixelConfig, true, GrMipMapped::kNo);
SkColorType colorType = kN32_SkColorType;
@ -431,7 +434,14 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsNonTexture_Gpu, reporter, ctxInfo)
}
gpu->deleteTestingOnlyBackendTexture(&backendTex);
}
}
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsNonTexture_Gpu, reporter, ctxInfo) {
test_write_pixels_non_texture(reporter, ctxInfo.grContext(), 1);
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsNonTextureMSAA_Gpu, reporter, ctxInfo) {
test_write_pixels_non_texture(reporter, ctxInfo.grContext(), 4);
}
static sk_sp<SkSurface> create_surf(GrContext* context, int width, int height) {