Valgrind is not a fan of uninitialized Src pixels.
E.g. search for ==31875== in this log:
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/774/steps/nanobench/logs/stdio
BUG=skia:4818
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1601093003
Review URL: https://codereview.chromium.org/1601093003
diff --git a/bench/BitmapScaleBench.cpp b/bench/BitmapScaleBench.cpp
index 2e8f72e..e309d51 100644
--- a/bench/BitmapScaleBench.cpp
+++ b/bench/BitmapScaleBench.cpp
@@ -124,12 +124,12 @@
PixmapScalerBench(SkBitmapScaler::ResizeMethod method, const char suffix[]) : fMethod(method) {
fName.printf("pixmapscaler_%s", suffix);
}
-
+
protected:
const char* onGetName() override {
return fName.c_str();
}
-
+
SkIPoint onGetSize() override { return{ 100, 100 }; }
bool isSuitableFor(Backend backend) override {
@@ -138,9 +138,10 @@
void onDelayedSetup() override {
fSrc.allocN32Pixels(640, 480);
+ fSrc.eraseColor(SK_ColorWHITE);
fDst.allocN32Pixels(300, 250);
}
-
+
void onDraw(int loops, SkCanvas*) override {
SkPixmap src, dst;
fSrc.peekPixels(&src);