Valgrind is not a fan of uninitialized Src pixels.
authormtklein <mtklein@chromium.org>
Tue, 19 Jan 2016 20:42:49 +0000 (12:42 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 19 Jan 2016 20:42:49 +0000 (12:42 -0800)
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

bench/BitmapScaleBench.cpp

index 2e8f72e..e309d51 100644 (file)
@@ -124,12 +124,12 @@ public:
     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 @@ protected:
 
     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);