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
This commit is contained in:
parent
5d0c0bfbbe
commit
5d415079fc
@ -68,6 +68,8 @@ static void makebm(SkBitmap* bm, int w, int h) {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user