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

Unified Diff: tests/SerializationTest.cpp

Issue 2339273002: SkFontData to use smart pointers. (Closed)
Patch Set: Add trivial bodies to the trivial implementations. Created 4 years, 3 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 | « tests/ExifTest.cpp ('k') | tests/YUVTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SerializationTest.cpp
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index ff9b342074adc1d7d8b5d54d4c7364077cda633b..bc2770ebda0d0a9e0143a408bf115e2ceb2f7bc8 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -13,6 +13,7 @@
#include "SkImage.h"
#include "SkImageSource.h"
#include "SkLightingShader.h"
+#include "SkMakeUnique.h"
#include "SkMallocPixelRef.h"
#include "SkNormalSource.h"
#include "SkOSFile.h"
@@ -370,13 +371,13 @@ static void TestPictureTypefaceSerialization(skiatest::Reporter* reporter) {
{
// Load typeface as stream to create with axis settings.
- SkAutoTDelete<SkStreamAsset> distortable(GetResourceAsStream("/fonts/Distortable.ttf"));
+ std::unique_ptr<SkStreamAsset> distortable(GetResourceAsStream("/fonts/Distortable.ttf"));
if (!distortable) {
INFOF(reporter, "Could not run fontstream test because Distortable.ttf not found.");
} else {
SkFixed axis = SK_FixedSqrt2;
sk_sp<SkTypeface> typeface(SkTypeface::MakeFromFontData(
- new SkFontData(distortable.release(), 0, &axis, 1)));
+ skstd::make_unique<SkFontData>(std::move(distortable), 0, &axis, 1)));
if (!typeface) {
INFOF(reporter, "Could not run fontstream test because Distortable.ttf not created.");
} else {
« no previous file with comments | « tests/ExifTest.cpp ('k') | tests/YUVTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698