New issue
Advanced search Search tips

Issue 884150 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Yesterday
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Numbers on 3D CSS (poster circle) experiment is not seen on Print-Preview.

Reported by aiman.an...@etouch.net, Sep 14

Issue description

Chrome Version: 71.0.3551.3 (Official Build) dd615454ca4829957e2bf8effaa805624820d825-refs/branch-heads/3551@{#9} (32/64 Bit).

OS: Windows(7,8,8.1,10), Mac(10.12.6, 10.13.1, 10.13.6, 10.14) and Linux(14.04 LTs).

Test URL: https://webkit.org/blog-files/3d-transforms/poster-circle.html

What steps will reproduce the problem?
1. Launch Chrome, navigate to the above test-url.
2. Give print command and check background graphics option.
3. Observe.

Actual Result: Numbers on poster circle is not seen on Print-Preview.
Expected Result: Numbers on poster circle should be seen on Print-Preview.

This is a regression issue, broken in M-68 series, below is manual regression range.

Good build: 67.0.3396.0 (Revision:550429)
Bad build: 68.0.3397.0 (Revision:550857)

Using the 'per-revision' script providing the bisect result:

You are probably looking for a change made after 550840 (known good), but no later than 550841 (first known bad).

CHANGE-LOG URL:

The script might not always return single CL as suspect as some perf builds might get missing due to failure.

https://chromium.googlesource.com/chromium/src/+log/4beb478f436f4b32d5ae37e23522cec229fd1d20..9a1b4b7f3050a08ed72bf693f57a2b74d52b9a87

Suspecting: https://chromium.googlesource.com/chromium/src/+/9a1b4b7f3050a08ed72bf693f57a2b74d52b9a87

@wangxianzhu: Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Kindly review the attached screen-cast for reference.

Thank you.
 
Actual Result.mov
3.6 MB View Download
Expected Result.mov
5.8 MB View Download
Labels: -Target-69 -Target-70
This is a mixed progression and regression. After the CL, clipping of the posters became correct while the text became missing.

Reduced test case:
<div style="-webkit-perspective: 800">
  <div style="transform: translateZ(1px); width: 100px; height: 100px; background: yellow; border-radius: 10px">TEXT</div>
</div>

Cc: halcanary@chromium.org
Components: -Blink>Paint Internals>Skia>PDF
Labels: -Pri-1 -Type-Bug-Regression -RegressedIn-68 -M-71 -Target-71 Pri-2 Type-Bug
Summary: Numbers on 3D CSS (poster circle) experiment is not seen on Print-Preview. (was: Regression: Numbers on 3D CSS (poster circle) experiment is not seen on Print-Preview.)
It seems that we hit a limitation of the skia pdf backend about 3d transforms. Before the CL, we converted 3d transforms to 2d when issuing transform paint operations which was incorrect. Now we issue correct 3d transforms.

The attached test case proves that it's not a paint issue, but a skia issue. It can produce correct result when it runs as a layout test which produces printing results in the same code path in blink as normal printing except that a normal bitmap canvas is used instead of a pdf canvas.

To run the test as a layout test:
1. save it under third_party/WebKit/printing
2. run-web-tests printing/poster.html
3. in the result page, expand the test result and select "actual" after "image:"
The actual 

Blink generates the following paint operations:
  {
    "method": "drawRect",
    "params": {
      "rect": {
        "left": 0,
        "top": 0,
        "right": 1066,
        "bottom": 799
      },
      "paint": {
        "textSize": 12,
        "textScaleX": 1,
        "textSkewX": 0,
        "color": "#FFFFFFFF",
        "strokeWidth": 0,
        "strokeMiter": 4,
        "flags": "AntiAlias",
        "filterLevel": "Low",
        "textAlign": "Left",
        "strokeCap": "Butt",
        "strokeJoin": "Miter",
        "styleName": "Fill",
        "textEncoding": "UTF-8",
        "hinting": "Normal",
        "blendMode": "Src"
      }
    }
  },
  {
    "method": "save"
  },
  {
    "method": "concat",
    "params": {
      "matrix": [1, -0.199171558022499, 92.3569183349609, 0, 0.497239172458649, 107.143562316895, 0, -0.000957555545028299, 0.924792885780335]
    }
  },
  {
    "method": "drawRRect",
    "params": {
      "rrect": {
        "type": "Simple",
        "left": 1,
        "top": 1,
        "right": 103,
        "bottom": 103,
        "upperLeftRadius": {
          "xRadius": 9,
          "yRadius": 9
        },
        "upperRightRadius": {
          "xRadius": 9,
          "yRadius": 9
        },
        "lowerRightRadius": {
          "xRadius": 9,
          "yRadius": 9
        },
        "lowerLeftRadius": {
          "xRadius": 9,
          "yRadius": 9
        }
      },
      "paint": {
        "textSize": 12,
        "textScaleX": 1,
        "textSkewX": 0,
        "color": "#FF000000",
        "strokeWidth": 2,
        "strokeMiter": 4,
        "flags": "AntiAlias",
        "filterLevel": "Low",
        "textAlign": "Left",
        "strokeCap": "Butt",
        "strokeJoin": "Miter",
        "styleName": "Stroke",
        "textEncoding": "UTF-8",
        "hinting": "Normal"
      }
    }
  },
  {
    "method": "drawTextBlob",
    "params": {
      "x": 2,
      "y": 17,
      "paint": {
        "textSize": 12,
        "textScaleX": 1,
        "textSkewX": 0,
        "color": "#FF000000",
        "strokeWidth": 0,
        "strokeMiter": 4,
        "flags": "AntiAlias",
        "filterLevel": "Low",
        "textAlign": "Left",
        "strokeCap": "Butt",
        "strokeJoin": "Miter",
        "styleName": "Fill",
        "textEncoding": "UTF-8",
        "hinting": "Normal"
      }
    }
  },
  {
    "method": "restore"
  }

halcanary@, is this a real limitation of skia pdf that text can't be 3d transformed? Is there workaround for it?

poster.html
306 bytes View Download
PDF does not support non-affine (perspective) transforms.  
Thanks halcanary@ for reply.

I have some more questions:

1. It is not feasible to implement, or a known bug?

2. Currently what does PDF do if it sees a perspective transform? I saw that some rounded borders and backgrounds can be correctly rendered with perspective transforms.

3. What would you suggest for correctly printing https://webkit.org/blog-files/3d-transforms/poster-circle.html?
PDF matrices have six components.

SkPDF sometimes rasterizes perspectives.  Sometimes, we apply the transform to the points of a SkPath.

SkPDF doens't do anything with text, but we *could* draw the text as paths.
About question 2, does SkPDF discard the paint operations under a perspective transform? It seems so based on the results because the text disappears. Can SkPDF just convert the perspective transform to affine transform and keep the paint operations? We could it in blink, but that would break with other skia backends that support perspective transforms.
Does this patch fix things?

https://review.skia.org/155609
Project Member

Comment 8 by bugdroid1@chromium.org, Sep 19

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/92c500b1119659ce6142ee79f676d80e99c69d05

commit 92c500b1119659ce6142ee79f676d80e99c69d05
Author: Hal Canary <halcanary@google.com>
Date: Wed Sep 19 21:03:25 2018

SkPDF: draw persepctive text

This improves the gm output on several gms:
    dftext_blob_persp
    dftext
    glyph_pos_h_f
    glyph_pos_n_f
    poly2poly
    shadertext2

Bug:  chromium:884150 
Change-Id: I16899f32ac2a8e7afdd2452017de6d27656679e7
Reviewed-on: https://skia-review.googlesource.com/155609
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>

[modify] https://crrev.com/92c500b1119659ce6142ee79f676d80e99c69d05/src/pdf/SkPDFDevice.cpp

Yes, the texts appear with the patch. Thanks for creating it.

This looks much better than the current status and than forcing affine transform in either blink or skia, though there are still some issues for contents under a perspective transform, e.g. square borders and backgrounds and objects (including texts) with near 90 degree rotateX or rotateY (not sure about the exact condition) are missing.
Cc: -halcanary@chromium.org wangxianzhu@chromium.org
Labels: -Pri-2 Pri-3
Owner: halcanary@chromium.org
With texts printed with paths, I think this bug is mostly fixed, just with some minor cases remaining as shown in the attached test case.

Assigning to halcanary@. Feel free to close this bug if all of the remaining cases are not feasible to fix.


perspective-print.html
1.2 KB View Download
halcanary@, please ignore the rotateX cases. It seems unrelated to Skia.
Project Member

Comment 12 by bugdroid1@chromium.org, Sep 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6bda60680b9b6f36d9bacfd5e0d620dced107bb3

commit 6bda60680b9b6f36d9bacfd5e0d620dced107bb3
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Wed Sep 19 23:19:37 2018

Roll src/third_party/skia a5c578ff3d46..d89e81168423 (8 commits)

https://skia.googlesource.com/skia.git/+log/a5c578ff3d46..d89e81168423


git log a5c578ff3d46..d89e81168423 --date=short --no-merges --format='%ad %ae %s'
2018-09-19 bungeman@google.com SkImageGeneratorCG.h to only expose factory method.
2018-09-19 michaelludwig@google.com Increase precision for two point gradient coordinates.
2018-09-19 halcanary@google.com SkPDF: draw persepctive text
2018-09-19 halcanary@google.com SkImageGeneratorWIC: make the header compile without src/.
2018-09-19 brianosman@google.com GrColor -> SkColor in one GM
2018-09-19 herb@google.com Clean up GPU strike sk_sp
2018-09-19 nodir@google.com Populate repo_path_map
2018-09-19 reed@google.com Revert "always optimize third_party code"


Created with:
  gclient setdep -r src/third_party/skia@d89e81168423

The AutoRoll server is located here: https://autoroll.skia.org/r/skia-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.

CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel

BUG= chromium:884150 , chromium:694348 
TBR=reed@chromium.org

Change-Id: I008043cc934cb833a7a9934714c6e9d17a99139f
Reviewed-on: https://chromium-review.googlesource.com/1234823
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#592597}
[modify] https://crrev.com/6bda60680b9b6f36d9bacfd5e0d620dced107bb3/DEPS

Is this good enough?
Screenshot_from_2018-09-20_10-19-19.png
46.5 KB View Download
Yes, this is very good. Thanks for fixing the text perspective case.

Can you also look at the square border/background case? I mixed it the case with the rotateX/Y issue (which is unrelated to Skia) in the #c10 test case. Please use the following test case for the square border/background issue:

<!DOCTYPE html>
<div style="width: 400px; -webkit-perspective: 800">
  <div style="width: 100px; height: 100px; transform: translateZ(1px); border: 2px solid blue; background: yellow">Square</div>
</div>

Please just close this bug if it's not feasible to support square border/background under perspective.
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/8b354dca8ce4b8388cc03e977140204b0f7b04ab

commit 8b354dca8ce4b8388cc03e977140204b0f7b04ab
Author: Hal Canary <halcanary@google.com>
Date: Thu Sep 20 17:47:43 2018

SkPDF: draw persepctive rectangles

Improvement to following render tests:
    gradients_view_perspective_nodither
    gradients_view_perspective
    persp_shaders_aa
    persp_shaders_bw
    poly2poly

Bug:  chromium:884150 
Change-Id: Ie0dd45e7756aa15af2f3c3855ceca1d3141844d6
Reviewed-on: https://skia-review.googlesource.com/155880
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

[modify] https://crrev.com/8b354dca8ce4b8388cc03e977140204b0f7b04ab/src/pdf/SkPDFDevice.cpp

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a2b9e4039caf49cac9febf397fac27cec6c2739b

commit a2b9e4039caf49cac9febf397fac27cec6c2739b
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Thu Sep 20 21:53:17 2018

Roll src/third_party/skia 7b11354810a9..268707284dcd (16 commits)

https://skia.googlesource.com/skia.git/+log/7b11354810a9..268707284dcd


git log 7b11354810a9..268707284dcd --date=short --no-merges --format='%ad %ae %s'
2018-09-20 fmalita@chromium.org [skottie] GM exercising external font loading
2018-09-20 mtklein@google.com send SkPMColor::toPMColor() through Sk4f_toL32()
2018-09-20 robertphillips@google.com Disable LCD text when drawing SkPictureImageFilter content
2018-09-20 brianosman@google.com Always use portable fonts in image filter test
2018-09-20 mtklein@google.com add interp-in-premul case to GM
2018-09-20 jvanverth@google.com Add new PolyUtils benches
2018-09-20 halcanary@google.com SkDocument:  Factories now located in SkPDFDocument.h and SkXPSDocument.h
2018-09-20 halcanary@google.com SkPDF: draw persepctive rectangles
2018-09-20 brianosman@google.com Some SkPM4f cleanup
2018-09-20 bungeman@google.com Remove SkAutoTCallIProc.
2018-09-20 mtklein@google.com have SkConvertPixels use SkColorSpaceXformSteps
2018-09-20 skia-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/externals/angle2 d511948b9f82..52ea49706fd7 (1 commits)
2018-09-20 brianosman@google.com Fix/simplify equal_pixels
2018-09-20 halcanary@google.com Document headers: IWYU
2018-09-20 jcgregorio@google.com Use new build targets in continuous build of skottie and debugger.
2018-09-20 brianosman@google.com Remove (unused) GrBlend.cpp, and some GrColor helpers


Created with:
  gclient setdep -r src/third_party/skia@268707284dcd

The AutoRoll server is located here: https://autoroll.skia.org/r/skia-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.

CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel

BUG=chromium:878874, chromium:884150 
TBR=reed@chromium.org

Change-Id: Ic7fa8bc7070238dfbb1d7c014446989ed87ecfaa
Reviewed-on: https://chromium-review.googlesource.com/1236881
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#592960}
[modify] https://crrev.com/a2b9e4039caf49cac9febf397fac27cec6c2739b/DEPS

Comment 18 by halcanary@google.com, Yesterday (36 hours ago)

Status: Fixed (was: Assigned)
Marking as fixed.  Someone please verify.

Sign in to add a comment