aboutsummaryrefslogtreecommitdiff
path: root/tests/GLProgramsTest.cpp
diff options
context:
space:
mode:
authorBrian Salomon <bsalomon@google.com>2016-12-08 10:35:19 -0500
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2016-12-08 16:27:44 +0000
commit9f549358b3ac9f61e78b194e39d6ac6eb322e35e (patch)
tree870b370b9985b1863abf4b1df0cce6d6f6ad5ac5 /tests/GLProgramsTest.cpp
parent978ccebd8af61417ecdb6d45a31cc68657eee752 (diff)
Remove antialiasing control from GrPaint.
This adds an additional param (of new enum type GrAA) to draws that can antialias and a new enum GrAAType to indicate the AA technique (none, fragment shader computed coverage, msaa). Some GMs change due to this: 1) In some places we weren't disabling MSAA when the draw was supposed to be unantialiased. 2) Some bounding rect draws that use GrFragmentProcessors were unnecessarily turning on antialiasing, by disabling it a very small number of pixel LSBs change. Change-Id: I7d8d8793dda70bcd373d09055beb9949c1a8a4d0 Reviewed-on: https://skia-review.googlesource.com/5608 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/GLProgramsTest.cpp')
-rw-r--r--tests/GLProgramsTest.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index cf4095a30b..0905505f71 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -255,9 +255,6 @@ static bool set_random_state(GrPaint* paint, SkRandom* random) {
if (random->nextBool()) {
paint->setAllowSRGBInputs(true);
}
- if (random->nextBool()) {
- paint->setAntiAlias(true);
- }
return random->nextBool();
}
@@ -339,8 +336,12 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
set_random_xpf(&grPaint, &ptd);
bool snapToCenters = set_random_state(&grPaint, &random);
const GrUserStencilSettings* uss = get_random_stencil(&random);
+ static constexpr GrAAType kAATypes[] = {GrAAType::kNone, GrAAType::kCoverage,
+ GrAAType::kHW};
+ GrAAType aaType = kAATypes[random.nextULessThan(SK_ARRAY_COUNT(kAATypes))];
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get(), uss, snapToCenters);
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, aaType, batch.get(), uss,
+ snapToCenters);
}
// Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes)
drawingManager->flush();
@@ -374,7 +375,8 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
BlockInputFragmentProcessor::Make(std::move(fp)));
grPaint.addColorFragmentProcessor(std::move(blockFP));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
drawingManager->flush();
}
}