jdk/test/java/awt/image/DrawImage/IncorrectDestinationOffset.java
author goetz
Tue, 14 Jun 2016 10:44:59 +0200
changeset 39056 d99e63b6d962
parent 25127 e92fa066b0e0
permissions -rw-r--r--
8159690: [TESTBUG] Mark headful tests with @key headful. Reviewed-by: simonis, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25127
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     1
/*
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 25127
diff changeset
     2
 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
25127
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     4
 *
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     8
 *
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    13
 * accompanied this code).
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    14
 *
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    18
 *
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    21
 * questions.
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    22
 */
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    23
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    24
import java.awt.AlphaComposite;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    25
import java.awt.Color;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    26
import java.awt.Graphics2D;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    27
import java.awt.GraphicsConfiguration;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    28
import java.awt.GraphicsEnvironment;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    29
import java.awt.image.BufferedImage;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    30
import java.awt.image.VolatileImage;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    31
import java.io.File;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    32
import java.io.IOException;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    33
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    34
import javax.imageio.ImageIO;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    35
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    36
/**
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    37
 * @test
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 25127
diff changeset
    38
 * @key headful
25127
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    39
 * @bug 8041129
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    40
 * @summary Destination offset should be correct in case of Surface->SW blit.
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    41
 *          Destination outside of the drawing area should be untouched.
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    42
 * @author Sergey Bylokhov
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    43
 */
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    44
public final class IncorrectDestinationOffset {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    45
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    46
    private static final int SIZE = 128;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    47
    private static final double[] SCALES = {0.25, 0.5, 1, 1.5, 2.0, 4};
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    48
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    49
    public static void main(final String[] args) throws IOException {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    50
        GraphicsEnvironment ge = GraphicsEnvironment
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    51
                .getLocalGraphicsEnvironment();
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    52
        GraphicsConfiguration gc = ge.getDefaultScreenDevice()
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    53
                                     .getDefaultConfiguration();
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    54
        VolatileImage vi = gc.createCompatibleVolatileImage(SIZE, SIZE);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    55
        BufferedImage bi = new BufferedImage(SIZE, SIZE,
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    56
                                             BufferedImage.TYPE_INT_ARGB);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    57
        for (double scale : SCALES) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    58
            while (true) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    59
                // initialize Volatile Image
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    60
                vi.validate(gc);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    61
                Graphics2D g2d = vi.createGraphics();
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    62
                g2d.setColor(Color.green);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    63
                g2d.fillRect(0, 0, SIZE, SIZE);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    64
                g2d.dispose();
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    65
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    66
                if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    67
                    try {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    68
                        Thread.sleep(100);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    69
                    } catch (InterruptedException ignored) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    70
                    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    71
                    continue;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    72
                }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    73
                // Draw the VolatileImage to BI with scale and offsets
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    74
                Graphics2D g = bi.createGraphics();
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    75
                g.setComposite(AlphaComposite.Src);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    76
                g.setColor(Color.RED);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    77
                g.fillRect(0, 0, SIZE / 2, SIZE / 2);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    78
                g.setColor(Color.BLUE);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    79
                g.fillRect(SIZE / 2, 0, SIZE / 2, SIZE / 2);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    80
                g.setColor(Color.ORANGE);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    81
                g.fillRect(0, SIZE / 2, SIZE / 2, SIZE / 2);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    82
                g.setColor(Color.MAGENTA);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    83
                g.fillRect(SIZE / 2, SIZE / 2, SIZE / 2, SIZE / 2);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    84
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    85
                int point2draw = (int) (100 * scale);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    86
                int size2draw = (int) (SIZE * scale);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    87
                g.drawImage(vi, point2draw, point2draw, size2draw, size2draw,
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    88
                            null);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    89
                g.dispose();
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    90
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    91
                if (vi.contentsLost()) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    92
                    try {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    93
                        Thread.sleep(100);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    94
                    } catch (InterruptedException ignored) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    95
                    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    96
                    continue;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    97
                }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    98
                validate(bi, point2draw, size2draw);
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
    99
                break;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   100
            }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   101
        }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   102
    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   103
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   104
    private static void validate(BufferedImage bi, int point2draw,
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   105
                                 int size2draw)
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   106
            throws IOException {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   107
        for (int x = 0; x < SIZE; ++x) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   108
            for (int y = 0; y < SIZE; ++y) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   109
                if (isInsideGreenArea(point2draw, size2draw, x, y)) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   110
                    if (bi.getRGB(x, y) != Color.green.getRGB()) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   111
                        ImageIO.write(bi, "png", new File("image.png"));
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   112
                        throw new RuntimeException("Test failed.");
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   113
                    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   114
                } else {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   115
                    if (isRedArea(x, y)) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   116
                        if (bi.getRGB(x, y) != Color.red.getRGB()) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   117
                            ImageIO.write(bi, "png", new File("image.png"));
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   118
                            throw new RuntimeException("Test failed.");
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   119
                        }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   120
                    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   121
                    if (isBlueArea(x, y)) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   122
                        if (bi.getRGB(x, y) != Color.blue.getRGB()) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   123
                            ImageIO.write(bi, "png", new File("image.png"));
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   124
                            throw new RuntimeException("Test failed.");
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   125
                        }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   126
                    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   127
                    if (isOrangeArea(x, y)) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   128
                        if (bi.getRGB(x, y) != Color.orange.getRGB()) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   129
                            ImageIO.write(bi, "png", new File("image.png"));
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   130
                            throw new RuntimeException("Test failed.");
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   131
                        }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   132
                    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   133
                    if (isMagentaArea(x, y)) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   134
                        if (bi.getRGB(x, y) != Color.magenta.getRGB()) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   135
                            ImageIO.write(bi, "png", new File("image.png"));
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   136
                            throw new RuntimeException("Test failed.");
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   137
                        }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   138
                    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   139
                }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   140
            }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   141
        }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   142
    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   143
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   144
    private static boolean isRedArea(int x, int y) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   145
        return x < SIZE / 2 && y < SIZE / 2;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   146
    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   147
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   148
    private static boolean isBlueArea(int x, int y) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   149
        return x >= SIZE / 2 && y < SIZE / 2;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   150
    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   151
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   152
    private static boolean isOrangeArea(int x, int y) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   153
        return x < SIZE / 2 && y >= SIZE / 2;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   154
    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   155
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   156
    private static boolean isMagentaArea(int x, int y) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   157
        return x >= SIZE / 2 && y >= SIZE / 2;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   158
    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   159
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   160
    private static boolean isInsideGreenArea(int point2draw, int size2draw,
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   161
                                             int x, int y) {
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   162
        return x >= point2draw && x < point2draw + size2draw && y >=
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   163
                point2draw && y < point2draw + size2draw;
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   164
    }
e92fa066b0e0 8041129: [OGL] surface->sw blit is extremely slow
serb
parents:
diff changeset
   165
}