jdk/src/windows/classes/sun/java2d/d3d/D3DRenderer.java
author henryjen
Thu, 05 Jun 2014 13:59:01 -0700
changeset 25192 4e2dc0f8702d
parent 23010 6dadb192ad81
permissions -rw-r--r--
8044551: Fix raw and unchecked lint warnings in platform-specific sun.awt files 8044396: Fix raw and unchecked lint warnings in platform-specific sun.java2d.* Reviewed-by: darcy, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 11897
diff changeset
     2
 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 887
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 887
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 887
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 887
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 887
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.java2d.d3d;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    28
import java.awt.Transparency;
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    29
import java.awt.geom.Path2D;
11897
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    30
import sun.java2d.InvalidPipeException;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import sun.java2d.SunGraphics2D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import sun.java2d.loops.GraphicsPrimitive;
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    33
import sun.java2d.pipe.BufferedPaints;
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    34
import sun.java2d.pipe.BufferedRenderPipe;
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    35
import sun.java2d.pipe.RenderQueue;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import sun.java2d.pipe.SpanIterator;
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    37
import sun.java2d.pipe.ParallelogramPipe;
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    38
import static sun.java2d.pipe.BufferedOpCodes.*;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    40
class D3DRenderer extends BufferedRenderPipe {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    42
    D3DRenderer(RenderQueue rq) {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    43
        super(rq);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    @Override
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    47
    protected void validateContext(SunGraphics2D sg2d) {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    48
        int ctxflags =
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    49
            sg2d.paint.getTransparency() == Transparency.OPAQUE ?
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    50
                D3DContext.SRC_IS_OPAQUE : D3DContext.NO_CONTEXT_FLAGS;
11897
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    51
        D3DSurfaceData dstData;
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    52
        try {
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    53
            dstData = (D3DSurfaceData)sg2d.surfaceData;
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    54
        } catch (ClassCastException e) {
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    55
            throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    56
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    57
        D3DContext.validateContext(dstData, dstData,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    58
                                   sg2d.getCompClip(), sg2d.composite,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    59
                                   null, sg2d.paint, sg2d, ctxflags);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    @Override
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    63
    protected void validateContextAA(SunGraphics2D sg2d) {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    64
        int ctxflags = D3DContext.NO_CONTEXT_FLAGS;
11897
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    65
        D3DSurfaceData dstData;
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    66
        try {
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    67
            dstData = (D3DSurfaceData)sg2d.surfaceData;
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    68
        } catch (ClassCastException e) {
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    69
            throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    70
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    71
        D3DContext.validateContext(dstData, dstData,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    72
                                   sg2d.getCompClip(), sg2d.composite,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    73
                                   null, sg2d.paint, sg2d, ctxflags);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    76
    void copyArea(SunGraphics2D sg2d,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    77
                  int x, int y, int w, int h, int dx, int dy)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    {
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    79
        rq.lock();
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    80
        try {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    81
            int ctxflags =
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    82
                sg2d.surfaceData.getTransparency() == Transparency.OPAQUE ?
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    83
                    D3DContext.SRC_IS_OPAQUE : D3DContext.NO_CONTEXT_FLAGS;
11897
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    84
            D3DSurfaceData dstData;
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    85
            try {
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    86
                dstData = (D3DSurfaceData)sg2d.surfaceData;
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    87
            } catch (ClassCastException e) {
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    88
                throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
9e80dbac0293 7112642: Incorrect checking for graphics rendering object
bagiras
parents: 9653
diff changeset
    89
            }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    90
            D3DContext.validateContext(dstData, dstData,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    91
                                       sg2d.getCompClip(), sg2d.composite,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    92
                                       null, null, null, ctxflags);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    93
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    94
            rq.ensureCapacity(28);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    95
            buf.putInt(COPY_AREA);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    96
            buf.putInt(x).putInt(y).putInt(w).putInt(h);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    97
            buf.putInt(dx).putInt(dy);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    98
        } finally {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    99
            rq.unlock();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   103
    protected native void drawPoly(int[] xPoints, int[] yPoints,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   104
                                   int nPoints, boolean isClosed,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   105
                                   int transX, int transY);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   107
    D3DRenderer traceWrap() {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   108
        return new Tracer(this);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    private class Tracer extends D3DRenderer {
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   112
        private D3DRenderer d3dr;
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   113
        Tracer(D3DRenderer d3dr) {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   114
            super(d3dr.rq);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   115
            this.d3dr = d3dr;
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   116
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   117
        public ParallelogramPipe getAAParallelogramPipe() {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   118
            final ParallelogramPipe realpipe = d3dr.getAAParallelogramPipe();
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   119
            return new ParallelogramPipe() {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   120
                public void fillParallelogram(SunGraphics2D sg2d,
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   121
                                              double ux1, double uy1,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   122
                                              double ux2, double uy2,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   123
                                              double x, double y,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   124
                                              double dx1, double dy1,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   125
                                              double dx2, double dy2)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   126
                {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   127
                    GraphicsPrimitive.tracePrimitive("D3DFillAAParallelogram");
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   128
                    realpipe.fillParallelogram(sg2d,
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   129
                                               ux1, uy1, ux2, uy2,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   130
                                               x, y, dx1, dy1, dx2, dy2);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   131
                }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   132
                public void drawParallelogram(SunGraphics2D sg2d,
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   133
                                              double ux1, double uy1,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   134
                                              double ux2, double uy2,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   135
                                              double x, double y,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   136
                                              double dx1, double dy1,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   137
                                              double dx2, double dy2,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   138
                                              double lw1, double lw2)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   139
                {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   140
                    GraphicsPrimitive.tracePrimitive("D3DDrawAAParallelogram");
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   141
                    realpipe.drawParallelogram(sg2d,
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   142
                                               ux1, uy1, ux2, uy2,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   143
                                               x, y, dx1, dy1, dx2, dy2,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   144
                                               lw1, lw2);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   145
                }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   146
            };
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   147
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   148
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   149
        protected void validateContext(SunGraphics2D sg2d) {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   150
            d3dr.validateContext(sg2d);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   151
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        public void drawLine(SunGraphics2D sg2d,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
                             int x1, int y1, int x2, int y2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            GraphicsPrimitive.tracePrimitive("D3DDrawLine");
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   156
            d3dr.drawLine(sg2d, x1, y1, x2, y2);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        public void drawRect(SunGraphics2D sg2d, int x, int y, int w, int h) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            GraphicsPrimitive.tracePrimitive("D3DDrawRect");
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   160
            d3dr.drawRect(sg2d, x, y, w, h);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   162
        protected void drawPoly(SunGraphics2D sg2d,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                                int[] xPoints, int[] yPoints,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   164
                                int nPoints, boolean isClosed)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        {
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   166
            GraphicsPrimitive.tracePrimitive("D3DDrawPoly");
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   167
            d3dr.drawPoly(sg2d, xPoints, yPoints, nPoints, isClosed);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        public void fillRect(SunGraphics2D sg2d, int x, int y, int w, int h) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            GraphicsPrimitive.tracePrimitive("D3DFillRect");
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   171
            d3dr.fillRect(sg2d, x, y, w, h);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   172
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   173
        protected void drawPath(SunGraphics2D sg2d,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   174
                                Path2D.Float p2df, int transx, int transy)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   175
        {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   176
            GraphicsPrimitive.tracePrimitive("D3DDrawPath");
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   177
            d3dr.drawPath(sg2d, p2df, transx, transy);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   179
        protected void fillPath(SunGraphics2D sg2d,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   180
                                Path2D.Float p2df, int transx, int transy)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   181
        {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   182
            GraphicsPrimitive.tracePrimitive("D3DFillPath");
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   183
            d3dr.fillPath(sg2d, p2df, transx, transy);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   184
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   185
        protected void fillSpans(SunGraphics2D sg2d, SpanIterator si,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   186
                                 int transx, int transy)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            GraphicsPrimitive.tracePrimitive("D3DFillSpans");
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   189
            d3dr.fillSpans(sg2d, si, transx, transy);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   190
        }
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   191
        public void fillParallelogram(SunGraphics2D sg2d,
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   192
                                      double ux1, double uy1,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   193
                                      double ux2, double uy2,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   194
                                      double x, double y,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   195
                                      double dx1, double dy1,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   196
                                      double dx2, double dy2)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   197
        {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   198
            GraphicsPrimitive.tracePrimitive("D3DFillParallelogram");
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   199
            d3dr.fillParallelogram(sg2d,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   200
                                   ux1, uy1, ux2, uy2,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   201
                                   x, y, dx1, dy1, dx2, dy2);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   203
        public void drawParallelogram(SunGraphics2D sg2d,
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   204
                                      double ux1, double uy1,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   205
                                      double ux2, double uy2,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   206
                                      double x, double y,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   207
                                      double dx1, double dy1,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   208
                                      double dx2, double dy2,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   209
                                      double lw1, double lw2)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        {
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   211
            GraphicsPrimitive.tracePrimitive("D3DDrawParallelogram");
9653
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   212
            d3dr.drawParallelogram(sg2d,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   213
                                   ux1, uy1, ux2, uy2,
6a1eff16874d 7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents: 5506
diff changeset
   214
                                   x, y, dx1, dy1, dx2, dy2, lw1, lw2);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        }
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   216
        public void copyArea(SunGraphics2D sg2d,
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   217
                             int x, int y, int w, int h, int dx, int dy)
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   218
        {
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   219
            GraphicsPrimitive.tracePrimitive("D3DCopyArea");
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   220
            d3dr.copyArea(sg2d, x, y, w, h, dx, dy);
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   221
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
}