aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/drawbitmaprect.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-02 14:22:38 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-02 14:22:38 +0000
commit5d415079fcd955e8b96f9b942e71dfc517819bd2 (patch)
treeebf96210c24c5195cefe6cf30b6e8a0cb2336585 /gm/drawbitmaprect.cpp
parent5d0c0bfbbe46596345d7bc864b7de12dad172773 (diff)
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
Diffstat (limited to 'gm/drawbitmaprect.cpp')
-rw-r--r--gm/drawbitmaprect.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index bc7e0359ed..d9b1434e57 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -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;