aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-09 15:10:07 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-09 20:43:41 +0000
commit0e8fc8b9e6a138cf4a66b421fb824679df717329 (patch)
tree9db412fc2ea22314336f3680249e905c4984902c /gm
parent385836d3d764303cc37c4d1bcc0ab890d209374e (diff)
Relandx2 "Remove antialiasing control from GrPaint."
Fixes a bad merge. This reverts commit 073285c0595d46205d1482cc19af2d7d891bfeae. Change-Id: I5e92339d9b33d3a6dc58b9fcd2a1b3a5684e8f8a Reviewed-on: https://skia-review.googlesource.com/5774 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'gm')
-rw-r--r--gm/beziereffects.cpp9
-rw-r--r--gm/bigrrectaaeffect.cpp3
-rw-r--r--gm/constcolorprocessor.cpp3
-rw-r--r--gm/convexpolyeffect.cpp6
-rw-r--r--gm/rrects.cpp4
-rw-r--r--gm/texdata.cpp4
-rw-r--r--gm/texturedomaineffect.cpp3
-rw-r--r--gm/windowrectangles.cpp9
-rw-r--r--gm/yuvtorgbeffect.cpp6
9 files changed, 29 insertions, 18 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index f924ee070a..9a1990b383 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -195,7 +195,8 @@ protected:
sk_sp<GrDrawOp> batch = sk_make_sp<BezierCubicOrConicTestBatch>(
gp, bounds, color, klmEqs, klmSigns[c]);
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
}
++col;
if (numCols == col) {
@@ -327,7 +328,8 @@ protected:
sk_sp<GrDrawOp> batch(
new BezierCubicOrConicTestBatch(gp, bounds, color, klmEqs, 1.f));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
}
++col;
if (numCols == col) {
@@ -538,7 +540,8 @@ protected:
sk_sp<GrDrawOp> batch(new BezierQuadTestBatch(gp, bounds, color, DevToUV));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
}
++col;
if (numCols == col) {
diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp
index b114f49fa4..9750d90197 100644
--- a/gm/bigrrectaaeffect.cpp
+++ b/gm/bigrrectaaeffect.cpp
@@ -90,7 +90,8 @@ protected:
sk_sp<GrDrawOp> batch(
GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMatrix::I(), bounds,
nullptr, nullptr));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
}
canvas->restore();
x = x + fTestOffsetX;
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index d70674279c..67b2b33e19 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -112,7 +112,8 @@ protected:
sk_sp<GrDrawOp> batch(
GrRectBatchFactory::CreateNonAAFill(grPaint.getColor(), viewMatrix,
renderRect, nullptr, nullptr));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
// Draw labels for the input to the processor and the processor to the right of
// the test rect. The input label appears above the processor label.
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 7a8c5b292a..c7a5d0c7f1 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -185,7 +185,8 @@ protected:
sk_sp<GrDrawOp> batch(new PolyBoundsBatch(p.getBounds(), 0xff000000));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
x += SkScalarCeilToScalar(path->getBounds().width() + kDX);
}
@@ -224,7 +225,8 @@ protected:
sk_sp<GrDrawOp> batch(new PolyBoundsBatch(rect, 0xff000000));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
x += SkScalarCeilToScalar(rect.width() + kDX);
}
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 268e449319..a3b31d55ca 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -118,7 +118,9 @@ protected:
sk_sp<GrDrawOp> batch(
GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMatrix::I(),
bounds, nullptr, nullptr));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint,
+ GrAAType::kNone,
+ batch.get());
} else {
drew = false;
}
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index 4a74468ac5..574dfad2be 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -102,7 +102,7 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) {
tm.postIDiv(2*S, 2*S);
paint.addColorTextureProcessor(texture, nullptr, tm);
- renderTargetContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S));
+ renderTargetContext->drawRect(clip, paint, GrAA::kNo, vm, SkRect::MakeWH(2*S, 2*S));
// now update the lower right of the texture in first pass
// or upper right in second pass
@@ -116,7 +116,7 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) {
texture->writePixels(S, (i ? 0 : S), S, S,
texture->config(), gTextureData.get(),
4 * stride);
- renderTargetContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S));
+ renderTargetContext->drawRect(clip, paint, GrAA::kNo, vm, SkRect::MakeWH(2*S, 2*S));
}
}
#endif
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index 9b46c53511..a3176ad7e7 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -129,7 +129,8 @@ protected:
sk_sp<GrDrawOp> batch(
GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, viewMatrix,
renderRect, nullptr, nullptr));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
x += renderRect.width() + kTestPad;
}
y += renderRect.height() + kTestPad;
diff --git a/gm/windowrectangles.cpp b/gm/windowrectangles.cpp
index e277db626c..e16392b423 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));
}
}
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp
index db0cf1b1ad..d4539ea71c 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -126,7 +126,8 @@ protected:
sk_sp<GrDrawOp> batch(
GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, viewMatrix,
renderRect, nullptr, nullptr));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
}
x += renderRect.width() + kTestPad;
}
@@ -238,7 +239,8 @@ protected:
grPaint.addColorFragmentProcessor(fp);
sk_sp<GrDrawOp> batch(GrRectBatchFactory::CreateNonAAFill(
GrColor_WHITE, viewMatrix, renderRect, nullptr, nullptr));
- renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch.get());
+ renderTargetContext->priv().testingOnly_drawBatch(grPaint, GrAAType::kNone,
+ batch.get());
}
}
}