Change flushing policy in GrContextPriv::writeSurfacePixels
Change flushing policy in GrContextPriv::writeSurfacePixels

Together with the following Chrome-side CL, this patch fixes Skia's flushing behavior for platforms that prefer flushes over VRAM use (i.e., ANGLE) and for platforms that don't (e.g., Android).

https://chromium-review.googlesource.com/c/chromium/src/+/1582181 (Remove additional FlushSkia in CanvasResourceProvider::WritePixels)

Here are the perf numbers on Android and Windows for the putImageData performance test:

                              Android (Nexus 5x)   Windows (i.e., ANGLE)
Current Chrome                        112.9             512.1
Chrome w/ 1582181                     131.9             334.8
Chrome w/ 1582181 and this CL         133.6             589.4

So, after both CLs have landed, Android will be faster while Windows will, roughly, remain the same.

Note, on ChromiumPerf the swing for the Nexus 5x is from 126.8 to 153.6 (so, a larger delta than I'm seeing here).

Bug: 942538, 953720
Change-Id: Iead6388e7a378240f87363e9a342d36a63f4c7f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210062
Reviewed-by: Brian Salomon <61fabaaf0876044aeedfd8e351e485c028d69e7b@google.com>
Commit-Queue: Robert Phillips <95e8ac5504948c7bf91b22c16a8dbb7ae7c66bfd@google.com>

google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,google/skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc