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

Unified Diff: src/gpu/GrTessellatingPathRenderer.cpp

Issue 1127183006: tesselating path renderer unit tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clang Created 5 years, 7 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
« no previous file with comments | « include/gpu/GrTestUtils.h ('k') | src/gpu/GrTestUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTessellatingPathRenderer.cpp
diff --git a/src/gpu/GrTessellatingPathRenderer.cpp b/src/gpu/GrTessellatingPathRenderer.cpp
index 24d4068cdb59d33556e2b3828344ed9ff2325c3d..e2707a9df31f761fef15e884b495bdf1c96b7e4e 100644
--- a/src/gpu/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/GrTessellatingPathRenderer.cpp
@@ -9,6 +9,7 @@
#include "GrBatch.h"
#include "GrBatchTarget.h"
+#include "GrBatchTest.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrPathUtils.h"
#include "GrVertices.h"
@@ -1514,3 +1515,23 @@ bool GrTessellatingPathRenderer::onDrawPath(GrDrawTarget* target,
return true;
}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifdef GR_TEST_UTILS
+
+BATCH_TEST_DEFINE(TesselatingPathRenderer) {
+ GrColor color = GrRandomColor(random);
+ SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random);
+ SkPath path = GrTest::TestPath(random);
+ SkRect clipBounds = GrTest::TestRect(random);
+ SkMatrix vmi;
+ bool result = viewMatrix.invert(&vmi);
+ if (!result) {
+ SkFAIL("Cannot invert matrix\n");
+ }
+ vmi.mapRect(&clipBounds);
+ return TessellatingPathBatch::Create(color, path, viewMatrix, clipBounds);
+}
+
+#endif
« no previous file with comments | « include/gpu/GrTestUtils.h ('k') | src/gpu/GrTestUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698