aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-08-02 14:40:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-02 14:40:46 -0700
commit38d909ec2875f79952de08f36adfaac5680d2c53 (patch)
treea11067146b42f3faa8531d6ef912f7246bbde1f2 /samplecode
parentada5a44f3bdac10a8a0c53b34f5add7aea9fdbb0 (diff)
Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004 Review-Url: https://codereview.chromium.org/2206633004
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/DecodeFile.h4
-rw-r--r--samplecode/SampleLua.cpp3
2 files changed, 3 insertions, 4 deletions
diff --git a/samplecode/DecodeFile.h b/samplecode/DecodeFile.h
index 26d5d2dc26..3995238bd0 100644
--- a/samplecode/DecodeFile.h
+++ b/samplecode/DecodeFile.h
@@ -12,8 +12,8 @@
inline bool decode_file(const char* filename, SkBitmap* bitmap,
SkColorType colorType = kN32_SkColorType, bool requireUnpremul = false) {
SkASSERT(kIndex_8_SkColorType != colorType);
- SkAutoTUnref<SkData> data(SkData::NewFromFileName(filename));
- SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data));
+ sk_sp<SkData> data(SkData::MakeFromFileName(filename));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data.get()));
if (!codec) {
return false;
}
diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp
index 96b15b91b8..4d492f488c 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -60,10 +60,9 @@ public:
fLua = new SkLua;
SkString str = GetResourcePath(LUA_FILENAME);
- SkData* data = SkData::NewFromFileName(str.c_str());
+ sk_sp<SkData> data(SkData::MakeFromFileName(str.c_str()));
if (data) {
fLua->runCode(data->data(), data->size());
- data->unref();
this->setImageFilename(fLua->get());
} else {
fLua->runCode(gMissingCode);