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

Side by Side Diff: tests/PathTest.cpp

Issue 137433003: Convert SkWriter32 to use an SkTDArray for its internal storage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: of course 0's fine too... Created 6 years, 11 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/ColorFilterTest.cpp ('k') | tests/SerializationTest.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 2011 Google Inc. 2 * Copyright 2011 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 "Test.h" 8 #include "Test.h"
9 #include "TestClassDef.h" 9 #include "TestClassDef.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 src.addRect(1, 1, 7, 7, SkPath::kCW_Direction); 1831 src.addRect(1, 1, 7, 7, SkPath::kCW_Direction);
1832 SkPaint strokePaint; 1832 SkPaint strokePaint;
1833 strokePaint.setStyle(SkPaint::kStroke_Style); 1833 strokePaint.setStyle(SkPaint::kStroke_Style);
1834 strokePaint.setStrokeWidth(2); 1834 strokePaint.setStrokeWidth(2);
1835 strokePaint.getFillPath(src, &dst); 1835 strokePaint.getFillPath(src, &dst);
1836 REPORTER_ASSERT(reporter, dst.isNestedRects(NULL)); 1836 REPORTER_ASSERT(reporter, dst.isNestedRects(NULL));
1837 } 1837 }
1838 1838
1839 static void write_and_read_back(skiatest::Reporter* reporter, 1839 static void write_and_read_back(skiatest::Reporter* reporter,
1840 const SkPath& p) { 1840 const SkPath& p) {
1841 SkWriter32 writer(100); 1841 SkWriter32 writer;
1842 writer.writePath(p); 1842 writer.writePath(p);
1843 size_t size = writer.bytesWritten(); 1843 size_t size = writer.bytesWritten();
1844 SkAutoMalloc storage(size); 1844 SkAutoMalloc storage(size);
1845 writer.flatten(storage.get()); 1845 writer.flatten(storage.get());
1846 SkReader32 reader(storage.get(), size); 1846 SkReader32 reader(storage.get(), size);
1847 1847
1848 SkPath readBack; 1848 SkPath readBack;
1849 REPORTER_ASSERT(reporter, readBack != p); 1849 REPORTER_ASSERT(reporter, readBack != p);
1850 reader.readPath(&readBack); 1850 reader.readPath(&readBack);
1851 REPORTER_ASSERT(reporter, readBack == p); 1851 REPORTER_ASSERT(reporter, readBack == p);
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
3360 test_rrect(reporter); 3360 test_rrect(reporter);
3361 test_arc(reporter); 3361 test_arc(reporter);
3362 test_arcTo(reporter); 3362 test_arcTo(reporter);
3363 test_addPath(reporter); 3363 test_addPath(reporter);
3364 test_conicTo_special_case(reporter); 3364 test_conicTo_special_case(reporter);
3365 test_get_point(reporter); 3365 test_get_point(reporter);
3366 test_contains(reporter); 3366 test_contains(reporter);
3367 PathTest_Private::TestPathTo(reporter); 3367 PathTest_Private::TestPathTo(reporter);
3368 PathRefTest_Private::TestPathRef(reporter); 3368 PathRefTest_Private::TestPathRef(reporter);
3369 } 3369 }
OLDNEW
« no previous file with comments | « tests/ColorFilterTest.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698