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

Side by Side Diff: tests/SerializationTest.cpp

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « tests/GifTest.cpp ('k') | tests/UtilsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkAnnotationKeys.h" 8 #include "SkAnnotationKeys.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 366
367 { 367 {
368 // Load typeface as stream to create with axis settings. 368 // Load typeface as stream to create with axis settings.
369 SkAutoTDelete<SkStreamAsset> distortable(GetResourceAsStream("/fonts/Dis tortable.ttf")); 369 SkAutoTDelete<SkStreamAsset> distortable(GetResourceAsStream("/fonts/Dis tortable.ttf"));
370 if (!distortable) { 370 if (!distortable) {
371 INFOF(reporter, "Could not run fontstream test because Distortable.t tf not found."); 371 INFOF(reporter, "Could not run fontstream test because Distortable.t tf not found.");
372 } else { 372 } else {
373 SkFixed axis = SK_FixedSqrt2; 373 SkFixed axis = SK_FixedSqrt2;
374 SkAutoTUnref<SkTypeface> typeface(SkTypeface::CreateFromFontData( 374 SkAutoTUnref<SkTypeface> typeface(SkTypeface::CreateFromFontData(
375 new SkFontData(distortable.detach(), 0, &axis, 1))); 375 new SkFontData(distortable.release(), 0, &axis, 1)));
376 if (!typeface) { 376 if (!typeface) {
377 INFOF(reporter, "Could not run fontstream test because Distortab le.ttf not created."); 377 INFOF(reporter, "Could not run fontstream test because Distortab le.ttf not created.");
378 } else { 378 } else {
379 serialize_and_compare_typeface(typeface, "abc", reporter); 379 serialize_and_compare_typeface(typeface, "abc", reporter);
380 } 380 }
381 } 381 }
382 } 382 }
383 } 383 }
384 384
385 static void setup_bitmap_for_canvas(SkBitmap* bitmap) { 385 static void setup_bitmap_for_canvas(SkBitmap* bitmap) {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 { r2, SkAnnotationKeys::Link_Named_Dest_Key(), d2 }, 622 { r2, SkAnnotationKeys::Link_Named_Dest_Key(), d2 },
623 }; 623 };
624 624
625 SkAutoTUnref<SkPicture> pict0(recorder.endRecording()); 625 SkAutoTUnref<SkPicture> pict0(recorder.endRecording());
626 SkAutoTUnref<SkPicture> pict1(copy_picture_via_serialization(pict0)); 626 SkAutoTUnref<SkPicture> pict1(copy_picture_via_serialization(pict0));
627 627
628 TestAnnotationCanvas canvas(reporter, recs, SK_ARRAY_COUNT(recs)); 628 TestAnnotationCanvas canvas(reporter, recs, SK_ARRAY_COUNT(recs));
629 canvas.drawPicture(pict1); 629 canvas.drawPicture(pict1);
630 } 630 }
631 631
OLDNEW
« no previous file with comments | « tests/GifTest.cpp ('k') | tests/UtilsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698