skia2/dm
Brian Osman 43f443f086 Fix caching of GL program binaries
Our "header" reading and writing code didn't agree, so we always failed
to recognize cached program binaries. The asserts in the testing sink
failed to notice, because we did get a 100% cache hit rate, but we
immediately discarded the data we received.

We now also check that we didn't insert anything into the cache, as a
proxy for doing any shader compile work. That change, plus the tweak to
set cached=false when the header fields are invalid (like we do if we
encounter problems further in the blob) detected the problem. Adding the
version tag to the start of the encoded blob fixes the test, and means
that program binary caching is actually working again.

This code still looks (and is) fragile. The next CL is going to rewrite
things to use SkReadBuffer and SkWriteBuffer, make the parsing code less
brittle, and give us a more robust way to detect failure anywhere in the
stream.

Bug: skia:9402
Change-Id: I0329f088e0afce3998494d91ef2206e5eb9cac42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294599
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-05 15:54:19 +00:00
..
DM.cpp Move SkBitmapRegionCodec into client_utils/android 2020-05-20 20:06:48 +00:00
DMGpuTestProcs.cpp Update internal skia uses to use flushAndSubmit and submit calls. 2020-05-14 20:26:44 +00:00
DMJsonWriter.cpp Remove all global mutexes 2019-06-18 00:39:15 +00:00
DMJsonWriter.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
DMSrcSink.cpp Fix caching of GL program binaries 2020-06-05 15:54:19 +00:00
DMSrcSink.h Move SkBitmapRegionCodec into client_utils/android 2020-05-20 20:06:48 +00:00