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

Unified Diff: src/gpu/GrTestUtils.cpp

Issue 1276633002: Revert of Implement caching of stroked paths in the tessellated path renderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTestUtils.cpp
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index 9e1dbce69140534d45382f8af76c7adddf15211c..b690d7e3cd4bc8f0e33b1dd31b27f0d8ed641196 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -5,10 +5,8 @@
* found in the LICENSE file.
*/
-#include "GrStrokeInfo.h"
#include "GrTestUtils.h"
#include "SkMatrix.h"
-#include "SkPathEffect.h"
#include "SkPath.h"
#include "SkRRect.h"
@@ -218,44 +216,21 @@
return gPath[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gPath)))];
}
-static void randomize_stroke_rec(SkStrokeRec* rec, SkRandom* random) {
- bool strokeAndFill = random->nextBool();
- SkScalar strokeWidth = random->nextBool() ? 0.f : 1.f;
- rec->setStrokeStyle(strokeWidth, strokeAndFill);
-
- SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::kCapCount));
- SkPaint::Join join = SkPaint::Join(random->nextULessThan(SkPaint::kJoinCount));
- SkScalar miterLimit = random->nextRangeScalar(1.f, 5.f);
- rec->setStrokeParams(cap, join, miterLimit);
-}
-
SkStrokeRec TestStrokeRec(SkRandom* random) {
SkStrokeRec::InitStyle style =
SkStrokeRec::InitStyle(random->nextULessThan(SkStrokeRec::kFill_InitStyle + 1));
SkStrokeRec rec(style);
- randomize_stroke_rec(&rec, random);
+ bool strokeAndFill = random->nextBool();
+ SkScalar strokeWidth = random->nextBool() ? 0.f : 1.f;
+ rec.setStrokeStyle(strokeWidth, strokeAndFill);
+
+ SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::kCapCount));
+ SkPaint::Join join = SkPaint::Join(random->nextULessThan(SkPaint::kJoinCount));
+ SkScalar miterLimit = random->nextRangeScalar(1.f, 5.f);
+ rec.setStrokeParams(cap, join, miterLimit);
return rec;
}
-GrStrokeInfo TestStrokeInfo(SkRandom* random) {
- SkStrokeRec::InitStyle style =
- SkStrokeRec::InitStyle(random->nextULessThan(SkStrokeRec::kFill_InitStyle + 1));
- GrStrokeInfo strokeInfo(style);
- randomize_stroke_rec(&strokeInfo, random);
- SkPathEffect::DashInfo dashInfo;
- dashInfo.fCount = random->nextRangeU(1, 100);
- dashInfo.fIntervals = SkNEW_ARRAY(SkScalar, dashInfo.fCount);
- SkScalar sum = 0;
- for (int i = 0; i < dashInfo.fCount; i++) {
- dashInfo.fIntervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01),
- SkDoubleToScalar(10.0));
- sum += dashInfo.fIntervals[i];
- }
- dashInfo.fPhase = random->nextRangeScalar(0, sum);
- strokeInfo.setDashInfo(dashInfo);
- return strokeInfo;
-}
-
};
#endif
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698