aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipStackClip.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-09 20:02:08 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-09 20:02:22 +0000
commit073285c0595d46205d1482cc19af2d7d891bfeae (patch)
treef127dd2c03ef707cd47396be0bf1cbf911403849 /src/gpu/GrClipStackClip.cpp
parent3944484020d98ff8f386378296106c321279482b (diff)
Revert "Reland "Remove antialiasing control from GrPaint.""
This reverts commit 3944484020d98ff8f386378296106c321279482b. Reason for revert: Merges badly with a recent change. Will rebase and reland. Original change's description: > Reland "Remove antialiasing control from GrPaint." > > This contains fixes for GLPrograms test and mixed samples rendering. > > This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4. > > BUG=skia: > > Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87 > Reviewed-on: https://skia-review.googlesource.com/5763 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Iff9657041e28604a845bc5a9acec7c9b248c53bd Reviewed-on: https://skia-review.googlesource.com/5772 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrClipStackClip.cpp')
-rw-r--r--src/gpu/GrClipStackClip.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 1172bc6a7b..e2ce0464f0 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -42,7 +42,7 @@ bool GrClipStackClip::quickContains(const SkRRect& rrect) const {
SkIntToScalar(fOrigin.fY)));
}
-bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, GrAA* aa) const {
+bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, bool* aa) const {
if (!fStack) {
return false;
}
@@ -54,9 +54,7 @@ bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, GrAA* aa)
tempRTBounds.offset(SkIntToScalar(fOrigin.fX), SkIntToScalar(fOrigin.fY));
rtBounds = &tempRTBounds;
}
- bool isAA;
- if (fStack->isRRect(*rtBounds, rr, &isAA)) {
- *aa = GrBoolToAA(isAA);
+ if (fStack->isRRect(*rtBounds, rr, aa)) {
if (origin) {
rr->offset(-SkIntToScalar(fOrigin.fX), -SkIntToScalar(fOrigin.fY));
}
@@ -134,16 +132,9 @@ bool GrClipStackClip::PathNeedsSWRenderer(GrContext* context,
canDrawArgs.fShaderCaps = context->caps()->shaderCaps();
canDrawArgs.fViewMatrix = &viewMatrix;
canDrawArgs.fShape = &shape;
- if (!element->isAA()) {
- canDrawArgs.fAAType = GrAAType::kNone;
- } else if (renderTargetContext->isUnifiedMultisampled()) {
- canDrawArgs.fAAType = GrAAType::kMSAA;
- } else if (renderTargetContext->isStencilBufferMultisampled()){
- canDrawArgs.fAAType = GrAAType::kMixedSamples;
- } else {
- canDrawArgs.fAAType = GrAAType::kCoverage;
- }
+ canDrawArgs.fAntiAlias = element->isAA();
canDrawArgs.fHasUserStencilSettings = hasUserStencilSettings;
+ canDrawArgs.fIsStencilBufferMSAA = renderTargetContext->isStencilBufferMultisampled();
// the 'false' parameter disallows use of the SW path renderer
GrPathRenderer* pr =
@@ -459,7 +450,6 @@ sk_sp<GrTexture> GrClipStackClip::CreateSoftwareClipMask(GrTextureProvider* texP
for (ElementList::Iter iter(reducedClip.elements()); iter.get(); iter.next()) {
const Element* element = iter.get();
SkClipOp op = element->getOp();
- GrAA aa = GrBoolToAA(element->isAA());
if (kIntersect_SkClipOp == op || kReverseDifference_SkClipOp == op) {
// Intersect and reverse difference require modifying pixels outside of the geometry
@@ -469,25 +459,25 @@ sk_sp<GrTexture> GrClipStackClip::CreateSoftwareClipMask(GrTextureProvider* texP
if (kReverseDifference_SkClipOp == op) {
SkRect temp = SkRect::Make(reducedClip.ibounds());
// invert the entire scene
- helper.drawRect(temp, SkRegion::kXOR_Op, GrAA::kNo, 0xFF);
+ helper.drawRect(temp, SkRegion::kXOR_Op, false, 0xFF);
}
SkPath clipPath;
element->asPath(&clipPath);
clipPath.toggleInverseFillType();
GrShape shape(clipPath, GrStyle::SimpleFill());
- helper.drawShape(shape, SkRegion::kReplace_Op, aa, 0x00);
+ helper.drawShape(shape, SkRegion::kReplace_Op, element->isAA(), 0x00);
continue;
}
// The other ops (union, xor, diff) only affect pixels inside
// the geometry so they can just be drawn normally
if (Element::kRect_Type == element->getType()) {
- helper.drawRect(element->getRect(), (SkRegion::Op)op, aa, 0xFF);
+ helper.drawRect(element->getRect(), (SkRegion::Op)op, element->isAA(), 0xFF);
} else {
SkPath path;
element->asPath(&path);
GrShape shape(path, GrStyle::SimpleFill());
- helper.drawShape(shape, (SkRegion::Op)op, aa, 0xFF);
+ helper.drawShape(shape, (SkRegion::Op)op, element->isAA(), 0xFF);
}
}