Mark drawbitmaprect's large bitmaps as immutable.
This reduces the peak memory usage of out/Debug/dm --skr --match drawbitmaprect from ~1.6G to ~200M.
I'm not sure how the numbers got so huge to begin with from a 2K x 2K 8888 bitmap (16MB).
BUG=skia:2378
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/265813007
git-svn-id: http://skia.googlecode.com/svn/trunk@14529 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index bc7e035..d9b1434 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -68,6 +68,8 @@
rect.inset(wScalar / 8, hScalar / 8);
mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4);
}
+ // Let backends know we won't change this, so they don't have to deep copy it defensively.
+ bm->setImmutable();
}
static const int gSize = 1024;