New issue
Advanced search Search tips

Issue 591805 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

anti-aliased clips don't work correctly in the Skia PDF backend

Project Member Reported by chrishtr@chromium.org, Mar 3 2016

Issue description

Need to attach a reduced testcase.

 crbug.com/590971  comment 0 has repro steps, except for needing to revert https://codereview.chromium.org/1751993004
 
Reduced testcase:

<!doctype HTML>
<div style="box-shadow: 1px  1px black; width: 200px; height: 200px;"></div>

Owner: halcanary@chromium.org
Hal could you fix?

Meantime, it seems we don't have the infrastructure to test PDF printing in layout tests. It would be nice to do that, has it been discussed before?
Repro steps:

1. Edit ClipDisplayItem.cpp to change line 19 to pass AntiAliased in the second parameter.
2. Build out/Release/chrome
3. Load the above example (comment #1)
4. ctrl-p to print

Print preview will show a black rectangle, rather than a white one with a 1px black shadow.

I have reduced this to the following Skia GM testcase:

    #include "gm.h"
    DEF_SIMPLE_GM(crbug_591805, canvas, 173, 173) {
        auto bigRect = SkRect::MakeWH(172.8f, 172.8f);
        auto rect = SkRect::MakeLTRB(6.4f, 6.4f, 166.4f, 166.4f);
        canvas->clipRect(bigRect, SkRegion::kIntersect_Op, true);
        canvas->clipRect(rect, SkRegion::kDifference_Op, false);
        canvas->translate(0.8f, 0.8f);
        canvas->drawRect(rect, SkPaint());
    }

SK_PDF_USE_PATHOPS_CLIPPING seems to fix this.  I will see if I can turn that on without breaking anything.

Status: Started (was: Assigned)
Project Member

Comment 6 by bugdroid1@chromium.org, Mar 31 2016

The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/dda239e25b54f4265734c62e2fdc76c872406f28

commit dda239e25b54f4265734c62e2fdc76c872406f28
Author: halcanary <halcanary@google.com>
Date: Thu Mar 31 14:33:57 2016

SkPDF: Use Pathops clipping

Turn this on all the time.  Remove the SK_PDF_USE_PATHOPS_CLIPPING
define that used to hide this functionality.

All rendering tests are the same or improved by this.

Also, remove non-functional SK_ALLOW_LARGE_PDF_SCALARS.

TBR=reed@google.com
    removing dead #defines from SkUserConfig.h

BUG= 591805 
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1845623002

Review URL: https://codereview.chromium.org/1845623002

[modify] https://crrev.com/dda239e25b54f4265734c62e2fdc76c872406f28/include/config/SkUserConfig.h
[modify] https://crrev.com/dda239e25b54f4265734c62e2fdc76c872406f28/src/pdf/SkPDFDevice.cpp

Waiting to verify in tomorrow's canary.

Comment 8 Deleted

I just realized that the canary means nothing, since I have to recompile with AntiAliased clips turned on.  I just did that with top-of-tree (commit 15ee578), and yes, it works as expected.
Also, chrishtr@, with respect to testing the printing workflow, I have an OKR to work on that.
Awesome, thanks for fixing. I will now revert https://codereview.chromium.org/1751993004.

For the OKR: what form do you plan for the tests to take?
Status: Assigned (was: Fixed)
I just tried at ToT and the steps reported in comment 0 of  issue 590971 
still repro.
Step one is here:  https://crbug.com/599185  . This would let me use existing Skia infrastructure to find regressions in Skia as they happen.
I can not reproduce. Can you get me a simple test case?
Owner: chrishtr@chromium.org
Hmm neither can I any more. Going to revert my patch in Blink now then.
Status: Fixed (was: Assigned)

Sign in to add a comment