aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/factory.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-24 20:03:00 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-24 20:03:00 +0000
commit9711e446676e6bf84b3fff916fd1d7537933a110 (patch)
tree652dc51c7f8ad24dcd205b6663be6ca14519c190 /gm/factory.cpp
parentd0419019de2a15a87d390fb0eed929acf9029d75 (diff)
Move MMap to SkData.
R=reed@google.com Author: bungeman@google.com Review URL: https://chromiumcodereview.appspot.com/14336003 git-svn-id: http://skia.googlecode.com/svn/trunk@8848 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/factory.cpp')
-rw-r--r--gm/factory.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/gm/factory.cpp b/gm/factory.cpp
index f4e8ae3b88..4538cda894 100644
--- a/gm/factory.cpp
+++ b/gm/factory.cpp
@@ -32,12 +32,12 @@ protected:
// Copyright-free file from http://openclipart.org/detail/29213/paper-plane-by-ddoo
filename.append("plane.png");
- SkFILEStream stream(filename.c_str());
- if (stream.isValid()) {
- stream.rewind();
- size_t length = stream.getLength();
+ SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(filename.c_str()));
+ if (NULL != stream.get()) {
+ stream->rewind();
+ size_t length = stream->getLength();
void* buffer = sk_malloc_throw(length);
- stream.read(buffer, length);
+ stream->read(buffer, length);
SkAutoDataUnref data(SkData::NewFromMalloc(buffer, length));
SkBitmapFactory factory(&SkImageDecoder::DecodeMemoryToTarget);
// Create a cache which will boot the pixels out anytime the