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

Side by Side Diff: tests/PictureTest.cpp

Issue 381133002: Remove SkPicture copy constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed unused "copy" method Created 6 years, 5 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 | « src/core/SkPictureData.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 2012 Google Inc. 2 * Copyright 2012 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 "SkBlurImageFilter.h" 8 #include "SkBlurImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 SkPictureRecorder recorder; 1529 SkPictureRecorder recorder;
1530 1530
1531 SkCanvas* canvas = recorder.beginRecording(1, 1); 1531 SkCanvas* canvas = recorder.beginRecording(1, 1);
1532 canvas->drawARGB(255, 255, 255, 255); 1532 canvas->drawARGB(255, 255, 255, 255);
1533 SkAutoTUnref<SkPicture> hasData(recorder.endRecording()); 1533 SkAutoTUnref<SkPicture> hasData(recorder.endRecording());
1534 // picture should have a non-zero id after recording 1534 // picture should have a non-zero id after recording
1535 REPORTER_ASSERT(reporter, hasData->uniqueID() != SK_InvalidGenID); 1535 REPORTER_ASSERT(reporter, hasData->uniqueID() != SK_InvalidGenID);
1536 1536
1537 // both pictures should have different ids 1537 // both pictures should have different ids
1538 REPORTER_ASSERT(reporter, hasData->uniqueID() != empty.uniqueID()); 1538 REPORTER_ASSERT(reporter, hasData->uniqueID() != empty.uniqueID());
1539
1540 // test out copy constructor
1541 SkPicture copyWithData(*hasData);
1542 REPORTER_ASSERT(reporter, hasData->uniqueID() == copyWithData.uniqueID());
1543
1544 SkPicture emptyCopy(empty);
1545 REPORTER_ASSERT(reporter, empty.uniqueID() != emptyCopy.uniqueID());
1546 } 1539 }
1547 1540
1548 DEF_TEST(Picture, reporter) { 1541 DEF_TEST(Picture, reporter) {
1549 #ifdef SK_DEBUG 1542 #ifdef SK_DEBUG
1550 test_deleting_empty_picture(); 1543 test_deleting_empty_picture();
1551 test_serializing_empty_picture(); 1544 test_serializing_empty_picture();
1552 #else 1545 #else
1553 test_bad_bitmap(); 1546 test_bad_bitmap();
1554 #endif 1547 #endif
1555 test_unbalanced_save_restores(reporter); 1548 test_unbalanced_save_restores(reporter);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); 1592 SkAutoTUnref<SkPicture> picture(recorder.endRecording());
1600 } 1593 }
1601 1594
1602 DEF_TEST(Canvas_EmptyBitmap, r) { 1595 DEF_TEST(Canvas_EmptyBitmap, r) {
1603 SkBitmap dst; 1596 SkBitmap dst;
1604 dst.allocN32Pixels(10, 10); 1597 dst.allocN32Pixels(10, 10);
1605 SkCanvas canvas(dst); 1598 SkCanvas canvas(dst);
1606 1599
1607 test_draw_bitmaps(&canvas); 1600 test_draw_bitmaps(&canvas);
1608 } 1601 }
OLDNEW
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698