In GrClipStackClip check whether op bounds are inside RT before checking for empty clip stack.
Also fixes the bounds of aa bevel stroked rectangles. Change-Id: I4c80deb9066ebbf9514ce3d4b270ff566bf12e02 Reviewed-on: https://skia-review.googlesource.com/9786 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
0c492cfe17
commit
510dd42a63
@ -250,15 +250,15 @@ static bool get_analytic_clip_processor(const ElementList& elements,
|
||||
bool GrClipStackClip::apply(GrContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
bool useHWAA, bool hasUserStencilSettings, GrAppliedClip* out,
|
||||
SkRect* bounds) const {
|
||||
if (!fStack || fStack->isWideOpen()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
SkRect devBounds = SkRect::MakeIWH(renderTargetContext->width(), renderTargetContext->height());
|
||||
if (!devBounds.intersect(*bounds)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!fStack || fStack->isWideOpen()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const GrReducedClip reducedClip(*fStack, devBounds,
|
||||
renderTargetContext->priv().maxWindowRectangles());
|
||||
|
||||
|
@ -138,7 +138,15 @@ public:
|
||||
compute_rects(&info.fDevOutside, &info.fDevOutsideAssist, &info.fDevInside,
|
||||
&info.fDegenerate, viewMatrix, rect, stroke.getWidth(), isMiter);
|
||||
info.fColor = color;
|
||||
op->setBounds(info.fDevOutside, HasAABloat::kYes, IsZeroArea::kNo);
|
||||
if (isMiter) {
|
||||
op->setBounds(info.fDevOutside, HasAABloat::kYes, IsZeroArea::kNo);
|
||||
} else {
|
||||
// The outer polygon of the bevel stroke is an octagon specified by the points of a
|
||||
// pair of overlapping rectangles where one is wide and the other is narrow.
|
||||
SkRect bounds = info.fDevOutside;
|
||||
bounds.joinPossiblyEmptyRect(info.fDevOutsideAssist);
|
||||
op->setBounds(bounds, HasAABloat::kYes, IsZeroArea::kNo);
|
||||
}
|
||||
op->fViewMatrix = viewMatrix;
|
||||
return std::unique_ptr<GrMeshDrawOp>(op);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user