DM: remove unnecessary use of std::function
This draw_to_canvas() function doesn't need the power of std::function.
This skips a copy or two, which is nice, and seems to clear
up most of my MSAN problems. Why? I do not know.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1718633002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN-Trybot
Review URL: https://codereview.chromium.org/1718633002
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 366d8f8..7ccaf22 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1043,17 +1043,18 @@
// passing the Sink draw() arguments, a size, and a function draws into an SkCanvas.
// Several examples below.
+template <typename Fn>
static Error draw_to_canvas(Sink* sink, SkBitmap* bitmap, SkWStream* stream, SkString* log,
- SkISize size, std::function<Error(SkCanvas*)> draw) {
+ SkISize size, const Fn& draw) {
class ProxySrc : public Src {
public:
- ProxySrc(SkISize size, std::function<Error(SkCanvas*)> draw) : fSize(size), fDraw(draw) {}
+ ProxySrc(SkISize size, const Fn& draw) : fSize(size), fDraw(draw) {}
Error draw(SkCanvas* canvas) const override { return fDraw(canvas); }
Name name() const override { sk_throw(); return ""; } // Won't be called.
SkISize size() const override { return fSize; }
private:
- SkISize fSize;
- std::function<Error(SkCanvas*)> fDraw;
+ SkISize fSize;
+ const Fn& fDraw;
};
return sink->draw(ProxySrc(size, draw), bitmap, stream, log);
}
diff --git a/tools/dm_flags.json b/tools/dm_flags.json
index 5950dfa..1191ac9 100644
--- a/tools/dm_flags.json
+++ b/tools/dm_flags.json
@@ -2076,8 +2076,20 @@
"--config",
"565",
"8888",
+ "gpu",
+ "upright-matrix-8888",
+ "upright-matrix-gpu",
+ "sp-8888",
+ "twice-8888",
+ "2ndpic-8888",
+ "remote-8888",
+ "remote_cache-8888",
+ "msaa16",
"pdf",
"pdf_poppler",
+ "serialize-8888",
+ "tiles_rt-8888",
+ "pic-8888",
"--src",
"tests",
"gm",
diff --git a/tools/dm_flags.py b/tools/dm_flags.py
index 747598f..db09eee 100755
--- a/tools/dm_flags.py
+++ b/tools/dm_flags.py
@@ -77,14 +77,6 @@
if 'GalaxyS3' in bot:
configs.append('gpudft')
- if 'MSAN' in bot:
- configs = [
- '565',
- '8888',
- 'pdf',
- 'pdf_poppler',
- ]
-
args.append('--config')
args.extend(configs)