jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8131 e2932d8114cb
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     1
/*
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8131
diff changeset
     2
 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     4
 *
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    10
 *
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    15
 * accompanied this code).
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    16
 *
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    20
 *
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    23
 * questions.
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    24
 */
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    25
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    26
package sun.java2d.pisces;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    27
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    28
import sun.awt.geom.PathConsumer2D;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    29
import java.awt.geom.AffineTransform;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    30
8131
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    31
final class TransformingPathConsumer2D {
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    32
    public static PathConsumer2D
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    33
        transformConsumer(PathConsumer2D out,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    34
                          AffineTransform at)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    35
    {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    36
        if (at == null) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    37
            return out;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    38
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    39
        float Mxx = (float) at.getScaleX();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    40
        float Mxy = (float) at.getShearX();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    41
        float Mxt = (float) at.getTranslateX();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    42
        float Myx = (float) at.getShearY();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    43
        float Myy = (float) at.getScaleY();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    44
        float Myt = (float) at.getTranslateY();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    45
        if (Mxy == 0f && Myx == 0f) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    46
            if (Mxx == 1f && Myy == 1f) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    47
                if (Mxt == 0f && Myt == 0f) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    48
                    return out;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    49
                } else {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    50
                    return new TranslateFilter(out, Mxt, Myt);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    51
                }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    52
            } else {
8131
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    53
                if (Mxt == 0f && Myt == 0f) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    54
                    return new DeltaScaleFilter(out, Mxx, Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    55
                } else {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    56
                    return new ScaleFilter(out, Mxx, Myy, Mxt, Myt);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    57
                }
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    58
            }
8131
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    59
        } else if (Mxt == 0f && Myt == 0f) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    60
            return new DeltaTransformFilter(out, Mxx, Mxy, Myx, Myy);
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    61
        } else {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    62
            return new TransformFilter(out, Mxx, Mxy, Mxt, Myx, Myy, Myt);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    63
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    64
    }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
    65
8131
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    66
    public static PathConsumer2D
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    67
        deltaTransformConsumer(PathConsumer2D out,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    68
                               AffineTransform at)
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    69
    {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    70
        if (at == null) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    71
            return out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    72
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    73
        float Mxx = (float) at.getScaleX();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    74
        float Mxy = (float) at.getShearX();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    75
        float Myx = (float) at.getShearY();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    76
        float Myy = (float) at.getScaleY();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    77
        if (Mxy == 0f && Myx == 0f) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    78
            if (Mxx == 1f && Myy == 1f) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    79
                return out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    80
            } else {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    81
                return new DeltaScaleFilter(out, Mxx, Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    82
            }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    83
        } else {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    84
            return new DeltaTransformFilter(out, Mxx, Mxy, Myx, Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    85
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    86
    }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    87
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    88
    public static PathConsumer2D
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    89
        inverseDeltaTransformConsumer(PathConsumer2D out,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    90
                                      AffineTransform at)
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    91
    {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    92
        if (at == null) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    93
            return out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    94
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    95
        float Mxx = (float) at.getScaleX();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    96
        float Mxy = (float) at.getShearX();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    97
        float Myx = (float) at.getShearY();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    98
        float Myy = (float) at.getScaleY();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
    99
        if (Mxy == 0f && Myx == 0f) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   100
            if (Mxx == 1f && Myy == 1f) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   101
                return out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   102
            } else {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   103
                return new DeltaScaleFilter(out, 1.0f/Mxx, 1.0f/Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   104
            }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   105
        } else {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   106
            float det = Mxx * Myy - Mxy * Myx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   107
            return new DeltaTransformFilter(out,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   108
                                            Myy / det,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   109
                                            -Mxy / det,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   110
                                            -Myx / det,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   111
                                            Mxx / det);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   112
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   113
    }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   114
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   115
    static final class TranslateFilter implements PathConsumer2D {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   116
        private final PathConsumer2D out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   117
        private final float tx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   118
        private final float ty;
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   119
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   120
        TranslateFilter(PathConsumer2D out,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   121
                        float tx, float ty)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   122
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   123
            this.out = out;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   124
            this.tx = tx;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   125
            this.ty = ty;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   126
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   127
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   128
        public void moveTo(float x0, float y0) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   129
            out.moveTo(x0 + tx, y0 + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   130
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   131
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   132
        public void lineTo(float x1, float y1) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   133
            out.lineTo(x1 + tx, y1 + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   134
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   135
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   136
        public void quadTo(float x1, float y1,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   137
                           float x2, float y2)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   138
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   139
            out.quadTo(x1 + tx, y1 + ty,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   140
                       x2 + tx, y2 + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   141
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   142
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   143
        public void curveTo(float x1, float y1,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   144
                            float x2, float y2,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   145
                            float x3, float y3)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   146
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   147
            out.curveTo(x1 + tx, y1 + ty,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   148
                        x2 + tx, y2 + ty,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   149
                        x3 + tx, y3 + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   150
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   151
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   152
        public void closePath() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   153
            out.closePath();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   154
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   155
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   156
        public void pathDone() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   157
            out.pathDone();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   158
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   159
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   160
        public long getNativeConsumer() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   161
            return 0;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   162
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   163
    }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   164
8131
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   165
    static final class ScaleFilter implements PathConsumer2D {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   166
        private final PathConsumer2D out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   167
        private final float sx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   168
        private final float sy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   169
        private final float tx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   170
        private final float ty;
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   171
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   172
        ScaleFilter(PathConsumer2D out,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   173
                    float sx, float sy, float tx, float ty)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   174
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   175
            this.out = out;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   176
            this.sx = sx;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   177
            this.sy = sy;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   178
            this.tx = tx;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   179
            this.ty = ty;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   180
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   181
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   182
        public void moveTo(float x0, float y0) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   183
            out.moveTo(x0 * sx + tx, y0 * sy + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   184
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   185
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   186
        public void lineTo(float x1, float y1) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   187
            out.lineTo(x1 * sx + tx, y1 * sy + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   188
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   189
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   190
        public void quadTo(float x1, float y1,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   191
                           float x2, float y2)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   192
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   193
            out.quadTo(x1 * sx + tx, y1 * sy + ty,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   194
                       x2 * sx + tx, y2 * sy + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   195
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   196
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   197
        public void curveTo(float x1, float y1,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   198
                            float x2, float y2,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   199
                            float x3, float y3)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   200
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   201
            out.curveTo(x1 * sx + tx, y1 * sy + ty,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   202
                        x2 * sx + tx, y2 * sy + ty,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   203
                        x3 * sx + tx, y3 * sy + ty);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   204
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   205
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   206
        public void closePath() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   207
            out.closePath();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   208
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   209
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   210
        public void pathDone() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   211
            out.pathDone();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   212
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   213
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   214
        public long getNativeConsumer() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   215
            return 0;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   216
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   217
    }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   218
8131
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   219
    static final class TransformFilter implements PathConsumer2D {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   220
        private final PathConsumer2D out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   221
        private final float Mxx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   222
        private final float Mxy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   223
        private final float Mxt;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   224
        private final float Myx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   225
        private final float Myy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   226
        private final float Myt;
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   227
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   228
        TransformFilter(PathConsumer2D out,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   229
                        float Mxx, float Mxy, float Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   230
                        float Myx, float Myy, float Myt)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   231
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   232
            this.out = out;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   233
            this.Mxx = Mxx;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   234
            this.Mxy = Mxy;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   235
            this.Mxt = Mxt;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   236
            this.Myx = Myx;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   237
            this.Myy = Myy;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   238
            this.Myt = Myt;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   239
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   240
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   241
        public void moveTo(float x0, float y0) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   242
            out.moveTo(x0 * Mxx + y0 * Mxy + Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   243
                       x0 * Myx + y0 * Myy + Myt);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   244
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   245
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   246
        public void lineTo(float x1, float y1) {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   247
            out.lineTo(x1 * Mxx + y1 * Mxy + Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   248
                       x1 * Myx + y1 * Myy + Myt);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   249
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   250
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   251
        public void quadTo(float x1, float y1,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   252
                           float x2, float y2)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   253
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   254
            out.quadTo(x1 * Mxx + y1 * Mxy + Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   255
                       x1 * Myx + y1 * Myy + Myt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   256
                       x2 * Mxx + y2 * Mxy + Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   257
                       x2 * Myx + y2 * Myy + Myt);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   258
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   259
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   260
        public void curveTo(float x1, float y1,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   261
                            float x2, float y2,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   262
                            float x3, float y3)
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   263
        {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   264
            out.curveTo(x1 * Mxx + y1 * Mxy + Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   265
                        x1 * Myx + y1 * Myy + Myt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   266
                        x2 * Mxx + y2 * Mxy + Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   267
                        x2 * Myx + y2 * Myy + Myt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   268
                        x3 * Mxx + y3 * Mxy + Mxt,
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   269
                        x3 * Myx + y3 * Myy + Myt);
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   270
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   271
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   272
        public void closePath() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   273
            out.closePath();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   274
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   275
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   276
        public void pathDone() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   277
            out.pathDone();
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   278
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   279
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   280
        public long getNativeConsumer() {
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   281
            return 0;
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   282
        }
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   283
    }
8131
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   284
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   285
    static final class DeltaScaleFilter implements PathConsumer2D {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   286
        private final float sx, sy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   287
        private final PathConsumer2D out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   288
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   289
        public DeltaScaleFilter(PathConsumer2D out, float Mxx, float Myy) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   290
            sx = Mxx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   291
            sy = Myy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   292
            this.out = out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   293
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   294
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   295
        public void moveTo(float x0, float y0) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   296
            out.moveTo(x0 * sx, y0 * sy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   297
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   298
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   299
        public void lineTo(float x1, float y1) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   300
            out.lineTo(x1 * sx, y1 * sy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   301
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   302
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   303
        public void quadTo(float x1, float y1,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   304
                           float x2, float y2)
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   305
        {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   306
            out.quadTo(x1 * sx, y1 * sy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   307
                       x2 * sx, y2 * sy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   308
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   309
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   310
        public void curveTo(float x1, float y1,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   311
                            float x2, float y2,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   312
                            float x3, float y3)
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   313
        {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   314
            out.curveTo(x1 * sx, y1 * sy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   315
                        x2 * sx, y2 * sy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   316
                        x3 * sx, y3 * sy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   317
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   318
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   319
        public void closePath() {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   320
            out.closePath();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   321
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   322
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   323
        public void pathDone() {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   324
            out.pathDone();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   325
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   326
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   327
        public long getNativeConsumer() {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   328
            return 0;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   329
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   330
    }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   331
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   332
    static final class DeltaTransformFilter implements PathConsumer2D {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   333
        private PathConsumer2D out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   334
        private final float Mxx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   335
        private final float Mxy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   336
        private final float Myx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   337
        private final float Myy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   338
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   339
        DeltaTransformFilter(PathConsumer2D out,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   340
                             float Mxx, float Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   341
                             float Myx, float Myy)
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   342
        {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   343
            this.out = out;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   344
            this.Mxx = Mxx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   345
            this.Mxy = Mxy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   346
            this.Myx = Myx;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   347
            this.Myy = Myy;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   348
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   349
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   350
        public void moveTo(float x0, float y0) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   351
            out.moveTo(x0 * Mxx + y0 * Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   352
                       x0 * Myx + y0 * Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   353
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   354
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   355
        public void lineTo(float x1, float y1) {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   356
            out.lineTo(x1 * Mxx + y1 * Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   357
                       x1 * Myx + y1 * Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   358
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   359
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   360
        public void quadTo(float x1, float y1,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   361
                           float x2, float y2)
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   362
        {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   363
            out.quadTo(x1 * Mxx + y1 * Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   364
                       x1 * Myx + y1 * Myy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   365
                       x2 * Mxx + y2 * Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   366
                       x2 * Myx + y2 * Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   367
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   368
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   369
        public void curveTo(float x1, float y1,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   370
                            float x2, float y2,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   371
                            float x3, float y3)
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   372
        {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   373
            out.curveTo(x1 * Mxx + y1 * Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   374
                        x1 * Myx + y1 * Myy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   375
                        x2 * Mxx + y2 * Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   376
                        x2 * Myx + y2 * Myy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   377
                        x3 * Mxx + y3 * Mxy,
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   378
                        x3 * Myx + y3 * Myy);
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   379
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   380
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   381
        public void closePath() {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   382
            out.closePath();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   383
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   384
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   385
        public void pathDone() {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   386
            out.pathDone();
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   387
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   388
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   389
        public long getNativeConsumer() {
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   390
            return 0;
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   391
        }
e2932d8114cb 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer
dlila
parents: 7668
diff changeset
   392
    }
6997
3642614e2282 6967434: Round joins/caps of scaled up lines have poor quality.
dlila
parents:
diff changeset
   393
}