commit | 7768751b8bec9e50fcbdad67b82e1962e71c3eb9 | [log] [tgz] |
---|---|---|
author | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | Tue May 21 16:17:14 2013 +0000 |
committer | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | Tue May 21 16:17:14 2013 +0000 |
tree | ebff6ac255d6e43a742873a36efea557c272c4f3 | |
parent | a55e48d6ef67daa90d17731b49d45b0ac94dcc34 [diff] [blame] |
Add buffer helper to read directly into SkString to avoid extra copying R=reed@google.com Review URL: https://codereview.chromium.org/15179008 git-svn-id: http://skia.googlecode.com/svn/trunk@9218 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/images/SkImageRef_ashmem.cpp b/src/images/SkImageRef_ashmem.cpp index dc60465..a4058ff 100644 --- a/src/images/SkImageRef_ashmem.cpp +++ b/src/images/SkImageRef_ashmem.cpp
@@ -223,9 +223,8 @@ fRec.fSize = 0; fRec.fPinned = false; fCT = NULL; - char* uri = buffer.readString(); - if (uri) { - setURI(uri); - sk_free(uri); - } + + SkString uri; + buffer.readString(&uri); + this->setURI(uri); }