Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: gm/drawbitmaprect.cpp

Issue 265813007: Mark drawbitmaprect's large bitmaps as immutable. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/drawbitmaprect.cpp
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index bc7e0359ed349797a8565b9e62b26ec7100846ee..d9b1434e57c3e236c4dc80f22c673aaccdd0ac42 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698