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

Side by Side Diff: tests/SerializationTest.cpp

Issue 1514503004: SkBitmap move (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-10 (Thursday) 17:55:13 EST Created 5 years 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
« src/core/SkBitmap.cpp ('K') | « tests/PDFJpegEmbedTest.cpp ('k') | no next file » | 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkFixed.h" 10 #include "SkFixed.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 SkAutoTUnref<SkColorFilter> copy( 289 SkAutoTUnref<SkColorFilter> copy(
290 TestFlattenableSerialization<SkColorFilter>(colorFilter.get(), true, rep orter)); 290 TestFlattenableSerialization<SkColorFilter>(colorFilter.get(), true, rep orter));
291 } 291 }
292 292
293 static SkBitmap draw_picture(SkPicture& picture) { 293 static SkBitmap draw_picture(SkPicture& picture) {
294 SkBitmap bitmap; 294 SkBitmap bitmap;
295 bitmap.allocN32Pixels(SkScalarCeilToInt(picture.cullRect().width()), 295 bitmap.allocN32Pixels(SkScalarCeilToInt(picture.cullRect().width()),
296 SkScalarCeilToInt(picture.cullRect().height())); 296 SkScalarCeilToInt(picture.cullRect().height()));
297 SkCanvas canvas(bitmap); 297 SkCanvas canvas(bitmap);
298 picture.playback(&canvas); 298 picture.playback(&canvas);
299 return bitmap; 299 return skstd::move(bitmap);
300 } 300 }
301 301
302 static void compare_bitmaps(skiatest::Reporter* reporter, 302 static void compare_bitmaps(skiatest::Reporter* reporter,
303 const SkBitmap& b1, const SkBitmap& b2) { 303 const SkBitmap& b1, const SkBitmap& b2) {
304 REPORTER_ASSERT(reporter, b1.width() == b2.width()); 304 REPORTER_ASSERT(reporter, b1.width() == b2.width());
305 REPORTER_ASSERT(reporter, b1.height() == b2.height()); 305 REPORTER_ASSERT(reporter, b1.height() == b2.height());
306 SkAutoLockPixels autoLockPixels1(b1); 306 SkAutoLockPixels autoLockPixels1(b1);
307 SkAutoLockPixels autoLockPixels2(b2); 307 SkAutoLockPixels autoLockPixels2(b2);
308 308
309 if ((b1.width() != b2.width()) || 309 if ((b1.width() != b2.width()) ||
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 539
540 // Deserialize picture 540 // Deserialize picture
541 SkValidatingReadBuffer reader(static_cast<void*>(data.get()), size); 541 SkValidatingReadBuffer reader(static_cast<void*>(data.get()), size);
542 SkAutoTUnref<SkPicture> readPict( 542 SkAutoTUnref<SkPicture> readPict(
543 SkPicture::CreateFromBuffer(reader)); 543 SkPicture::CreateFromBuffer(reader));
544 REPORTER_ASSERT(reporter, readPict.get()); 544 REPORTER_ASSERT(reporter, readPict.get());
545 } 545 }
546 546
547 TestPictureTypefaceSerialization(reporter); 547 TestPictureTypefaceSerialization(reporter);
548 } 548 }
OLDNEW
« src/core/SkBitmap.cpp ('K') | « tests/PDFJpegEmbedTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698