1 /*
2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package sun.java2d.pipe;
27 
28 import java.awt.Color;
29 import java.awt.Image;
30 import java.awt.Shape;
31 import java.awt.geom.AffineTransform;
32 import java.awt.image.BufferedImage;
33 import java.awt.image.BufferedImageOp;
34 import java.awt.image.ImageObserver;
35 import java.awt.font.GlyphVector;
36 import sun.java2d.SunGraphics2D;
37 
38 /**
39  * This is a class that implements all of the basic pixel rendering
40  * methods as NOPs.
41  * This class is useful for installing as the pipeline when the
42  * clip is determined to be empty or when the composite operation is
43  * determined to have no effect (i.e. rule == SRC_OVER, extraAlpha == 0.0).
44  */
45 public class NullPipe
46     implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, TextPipe,
47     DrawImagePipe
48 {
drawLine(SunGraphics2D sg, int x1, int y1, int x2, int y2)49     public void drawLine(SunGraphics2D sg,
50                          int x1, int y1, int x2, int y2) {
51     }
52 
drawRect(SunGraphics2D sg, int x, int y, int width, int height)53     public void drawRect(SunGraphics2D sg,
54                          int x, int y, int width, int height) {
55     }
56 
fillRect(SunGraphics2D sg, int x, int y, int width, int height)57     public void fillRect(SunGraphics2D sg,
58                          int x, int y, int width, int height) {
59     }
60 
drawRoundRect(SunGraphics2D sg, int x, int y, int width, int height, int arcWidth, int arcHeight)61     public void drawRoundRect(SunGraphics2D sg,
62                               int x, int y, int width, int height,
63                               int arcWidth, int arcHeight) {
64     }
65 
fillRoundRect(SunGraphics2D sg, int x, int y, int width, int height, int arcWidth, int arcHeight)66     public void fillRoundRect(SunGraphics2D sg,
67                               int x, int y, int width, int height,
68                               int arcWidth, int arcHeight) {
69     }
70 
drawOval(SunGraphics2D sg, int x, int y, int width, int height)71     public void drawOval(SunGraphics2D sg,
72                          int x, int y, int width, int height) {
73     }
74 
fillOval(SunGraphics2D sg, int x, int y, int width, int height)75     public void fillOval(SunGraphics2D sg,
76                          int x, int y, int width, int height) {
77     }
78 
drawArc(SunGraphics2D sg, int x, int y, int width, int height, int startAngle, int arcAngle)79     public void drawArc(SunGraphics2D sg,
80                         int x, int y, int width, int height,
81                         int startAngle, int arcAngle) {
82     }
83 
fillArc(SunGraphics2D sg, int x, int y, int width, int height, int startAngle, int arcAngle)84     public void fillArc(SunGraphics2D sg,
85                         int x, int y, int width, int height,
86                         int startAngle, int arcAngle) {
87     }
88 
drawPolyline(SunGraphics2D sg, int[] xPoints, int[] yPoints, int nPoints)89     public void drawPolyline(SunGraphics2D sg,
90                              int[] xPoints, int[] yPoints,
91                              int nPoints) {
92     }
93 
drawPolygon(SunGraphics2D sg, int[] xPoints, int[] yPoints, int nPoints)94     public void drawPolygon(SunGraphics2D sg,
95                             int[] xPoints, int[] yPoints,
96                             int nPoints) {
97     }
98 
fillPolygon(SunGraphics2D sg, int[] xPoints, int[] yPoints, int nPoints)99     public void fillPolygon(SunGraphics2D sg,
100                             int[] xPoints, int[] yPoints,
101                             int nPoints) {
102     }
103 
draw(SunGraphics2D sg, Shape s)104     public void draw(SunGraphics2D sg, Shape s) {
105     }
106 
fill(SunGraphics2D sg, Shape s)107     public void fill(SunGraphics2D sg, Shape s) {
108     }
109 
drawString(SunGraphics2D sg, String s, double x, double y)110     public void drawString(SunGraphics2D sg, String s, double x, double y) {
111     }
112 
drawGlyphVector(SunGraphics2D sg, GlyphVector g, float x, float y)113     public void drawGlyphVector(SunGraphics2D sg, GlyphVector g,
114                                 float x, float y) {
115     }
116 
drawChars(SunGraphics2D sg, char[] data, int offset, int length, int x, int y)117     public void drawChars(SunGraphics2D sg,
118                                 char[] data, int offset, int length,
119                                 int x, int y) {
120     }
121 
copyImage(SunGraphics2D sg, Image img, int x, int y, Color bgColor, ImageObserver observer)122     public boolean copyImage(SunGraphics2D sg, Image img,
123                              int x, int y,
124                              Color bgColor,
125                              ImageObserver observer) {
126         return false;
127     }
copyImage(SunGraphics2D sg, Image img, int dx, int dy, int sx, int sy, int w, int h, Color bgColor, ImageObserver observer)128     public boolean copyImage(SunGraphics2D sg, Image img,
129                              int dx, int dy, int sx, int sy, int w, int h,
130                              Color bgColor,
131                              ImageObserver observer) {
132         return false;
133     }
scaleImage(SunGraphics2D sg, Image img, int x, int y, int w, int h, Color bgColor, ImageObserver observer)134     public boolean scaleImage(SunGraphics2D sg, Image img, int x, int y,
135                               int w, int h,
136                               Color bgColor,
137                               ImageObserver observer) {
138         return false;
139     }
scaleImage(SunGraphics2D sg, Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgColor, ImageObserver observer)140     public boolean scaleImage(SunGraphics2D sg, Image img,
141                               int dx1, int dy1, int dx2, int dy2,
142                               int sx1, int sy1, int sx2, int sy2,
143                               Color bgColor,
144                               ImageObserver observer) {
145         return false;
146     }
transformImage(SunGraphics2D sg, Image img, AffineTransform atfm, ImageObserver observer)147     public boolean transformImage(SunGraphics2D sg, Image img,
148                                   AffineTransform atfm,
149                                   ImageObserver observer) {
150         return false;
151     }
transformImage(SunGraphics2D sg, BufferedImage img, BufferedImageOp op, int x, int y)152     public void transformImage(SunGraphics2D sg, BufferedImage img,
153                                BufferedImageOp op, int x, int y) {
154     }
155 }
156