aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRecords.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-05-04 13:51:11 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-04 18:56:13 +0000
commit738b80d8a53cba281eae1013069843ffe32f9a29 (patch)
tree78e5d0bc06148f76959d264cba8b44650e5caf94 /src/core/SkRecords.h
parent5570ea0c2549722f4069add1875743e6c44fc50b (diff)
Don't use getDeviceClipBounds() to bound pic ops.
The values returned by SkCanvas::getDeviceClipBounds() are in the right space, but have extra constraints on them that are not desirable for bounding the logical bounds of draw operations: - they are integral - they are non-negative We've been intersecting the bounds of each operation with these bounds, which means we're mixing these bogus constraints into the bounds of each recorded operation. This percolates up to the SkPicutre cull rect too. The most egregious way to see the problem is to record a draw op entirely in negative space... it'll come back with empty logical bounds rather than its correct (negative-space) bounds. I've added a test for this, and another test I also think should be passing but left making it so as a follow up. I've had to disable a couple tests asserting clips affect the bounds. :/ A possible follow-up might go back to using the clips to tighten the bounds of the ops, just so long as we take the original user bounds and map them with the CTM through to device space ourselves, rather than relying on the recording canvas' clip stack. I think this means we'd need to maintain our own stack of device-space float SkRect clip bounds while calculating these op bounds. Bug: skia:7735 Change-Id: I6bf15f6b2a9ba4329a4eeae7f9d57aa8729ec1bb Reviewed-on: https://skia-review.googlesource.com/126002 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/core/SkRecords.h')
-rw-r--r--src/core/SkRecords.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h
index f1e70b6c88..67424aca2a 100644
--- a/src/core/SkRecords.h
+++ b/src/core/SkRecords.h
@@ -177,7 +177,6 @@ struct T { \
RECORD(NoOp, 0);
RECORD(Flush, 0);
RECORD(Restore, 0,
- SkIRect devBounds;
TypedMatrix matrix);
RECORD(Save, 0);
@@ -212,19 +211,15 @@ private:
static_assert(sizeof(ClipOpAndAA) == 4, "ClipOpAndAASize");
RECORD(ClipPath, 0,
- SkIRect devBounds;
PreCachedPath path;
ClipOpAndAA opAA);
RECORD(ClipRRect, 0,
- SkIRect devBounds;
SkRRect rrect;
ClipOpAndAA opAA);
RECORD(ClipRect, 0,
- SkIRect devBounds;
SkRect rect;
ClipOpAndAA opAA);
RECORD(ClipRegion, 0,
- SkIRect devBounds;
SkRegion region;
SkClipOp op);