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

Unified Diff: tests/PathTest.cpp

Issue 22471002: Restore SkPath(const SkPath&) to copy the generation ID on Android. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: uppercase Created 7 years, 4 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
« src/core/SkPath.cpp ('K') | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathTest.cpp
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index e33c912062228589f95e585aaa3b64771c89206b..b3980179383e76e0c5a128bdd993073b8a3c8f9d 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -15,8 +15,9 @@
#include "SkRandom.h"
#include "SkReader32.h"
#include "SkSize.h"
-#include "SkWriter32.h"
#include "SkSurface.h"
+#include "SkTypes.h"
+#include "SkWriter32.h"
#if defined(WIN32)
#define SUPPRESS_VISIBILITY_WARNING
@@ -31,6 +32,18 @@ static SkSurface* new_surface(int w, int h) {
return SkSurface::NewRaster(info);
}
+static void test_android_specific_behavior(skiatest::Reporter* reporter) {
+#ifdef SK_BUILD_FOR_ANDROID
+ SkPath path;
+ path.moveTo(0, 0);
+ path.lineTo(1, 1);
+ REPORTER_ASSERT(path.getGenerationID() > 0);
+
+ const SkPath copy(path);
+ REPORTER_ASSERT(path.getGenerationID() == copy.getGenerationID());
+#endif
+}
+
// This used to assert in the debug build, as the edges did not all line-up.
static void test_bad_cubic_crbug234190() {
SkPath path;
@@ -2450,6 +2463,7 @@ static void TestPath(skiatest::Reporter* reporter) {
test_crbug_170666();
test_bad_cubic_crbug229478();
test_bad_cubic_crbug234190();
+ test_android_specific_behavior(reporter);
}
#include "TestClassDef.h"
« src/core/SkPath.cpp ('K') | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698