aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/windowrectangles.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-08 10:35:19 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-08 16:27:44 +0000
commit9f549358b3ac9f61e78b194e39d6ac6eb322e35e (patch)
tree870b370b9985b1863abf4b1df0cce6d6f6ad5ac5 /gm/windowrectangles.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 'gm/windowrectangles.cpp')
-rw-r--r--gm/windowrectangles.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/gm/windowrectangles.cpp b/gm/windowrectangles.cpp
index 3949b3f41c..94da20b7f1 100644
--- a/gm/windowrectangles.cpp
+++ b/gm/windowrectangles.cpp
@@ -141,7 +141,7 @@ private:
class MaskOnlyClipBase : public GrClip {
private:
bool quickContains(const SkRect&) const final { return false; }
- bool isRRect(const SkRect& rtBounds, SkRRect* rr, bool* aa) const final { return false; }
+ bool isRRect(const SkRect& rtBounds, SkRRect* rr, GrAA*) const final { return false; }
void getConservativeBounds(int width, int height, SkIRect* rect, bool* iior) const final {
rect->set(0, 0, width, height);
if (iior) {
@@ -190,7 +190,6 @@ void WindowRectanglesMaskGM::onCoverClipStack(const SkClipStack& stack, SkCanvas
const GrReducedClip reducedClip(stack, SkRect::Make(kCoverRect), kNumWindows);
GrPaint paint;
- paint.setAntiAlias(true);
if (!rtc->isStencilBufferMultisampled()) {
paint.setColor4f(GrColor4f(0, 0.25f, 1, 1));
this->visualizeAlphaMask(ctx, rtc, reducedClip, paint);
@@ -217,7 +216,7 @@ void WindowRectanglesMaskGM::visualizeAlphaMask(GrContext* ctx, GrRenderTargetCo
this->stencilCheckerboard(maskRTC.get(), true);
maskRTC->clear(nullptr, GrColorPackA4(0xff), true);
maskRTC->priv().drawAndStencilRect(StencilOnlyClip(), &GrUserStencilSettings::kUnused,
- SkRegion::kDifference_Op, false, false, SkMatrix::I(),
+ SkRegion::kDifference_Op, false, GrAA::kNo, SkMatrix::I(),
SkRect::MakeIWH(maskRTC->width(), maskRTC->height()));
reducedClip.drawAlphaClipMask(maskRTC.get());
sk_sp<GrTexture> mask(maskRTC->asTexture());
@@ -229,7 +228,7 @@ void WindowRectanglesMaskGM::visualizeAlphaMask(GrContext* ctx, GrRenderTargetCo
// inside window rectangles or outside the scissor should still have the initial checkerboard
// intact. (This verifies we didn't spend any time modifying those pixels in the mask.)
AlphaOnlyClip clip(mask.get(), x, y);
- rtc->drawRect(clip, paint, SkMatrix::I(),
+ rtc->drawRect(clip, paint, GrAA::kYes, SkMatrix::I(),
SkRect::Make(SkIRect::MakeXYWH(x, y, mask->width(), mask->height())));
}
@@ -268,7 +267,7 @@ void WindowRectanglesMaskGM::stencilCheckerboard(GrRenderTargetContext* rtc, boo
for (int x = (y & 1) == flip ? 0 : kMaskCheckerSize;
x < kLayerRect.width(); x += 2 * kMaskCheckerSize) {
SkIRect checker = SkIRect::MakeXYWH(x, y, kMaskCheckerSize, kMaskCheckerSize);
- rtc->priv().stencilRect(GrNoClip(), &kSetClip, false, SkMatrix::I(),
+ rtc->priv().stencilRect(GrNoClip(), &kSetClip, GrAAType::kNone, SkMatrix::I(),
SkRect::Make(checker));
}
}