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

Unified Diff: gm/factory.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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
Index: gm/factory.cpp
diff --git a/gm/factory.cpp b/gm/factory.cpp
index 831cff0b9f90f693b6686288bc51ec77611575bb..dfecd167f9433937b99d5ff95ccc7c14518d417f 100644
--- a/gm/factory.cpp
+++ b/gm/factory.cpp
@@ -29,15 +29,15 @@ protected:
void onOnceBeforeDraw() override {
// Copyright-free file from http://openclipart.org/detail/29213/paper-plane-by-ddoo
SkString pngFilename = GetResourcePath("plane.png");
- SkAutoDataUnref data(SkData::NewFromFileName(pngFilename.c_str()));
- if (data.get()) {
+ sk_sp<SkData> data(SkData::MakeFromFileName(pngFilename.c_str()));
+ if (data) {
// Create a cache which will boot the pixels out anytime the
// bitmap is unlocked.
SkAutoTUnref<SkDiscardableMemoryPool> pool(
SkDiscardableMemoryPool::Create(1));
SkAssertResult(SkDEPRECATED_InstallDiscardablePixelRef(
- SkImageGenerator::NewFromEncoded(data),
- nullptr, &fBitmap, pool));
+ SkImageGenerator::NewFromEncoded(data.get()),
+ nullptr, &fBitmap, pool));
}
}
« no previous file with comments | « gm/annotated_text.cpp ('k') | gm/internal_links.cpp » ('j') | include/core/SkData.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698