2685N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2370N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2370N/A * This code is free software; you can redistribute it and/or modify it 2370N/A * under the terms of the GNU General Public License version 2 only, as 2685N/A * published by the Free Software Foundation. Oracle designates this 2370N/A * particular file as subject to the "Classpath" exception as provided 2685N/A * by Oracle in the LICENSE file that accompanied this code. 2370N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2370N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2370N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2370N/A * version 2 for more details (a copy is included in the LICENSE file that 2370N/A * You should have received a copy of the GNU General Public License version 2370N/A * 2 along with this work; if not, write to the Free Software Foundation, 2370N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2685N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2685N/A * or visit www.oracle.com if you need additional information or have any 2370N/A // If there is no area touched by the traps, don't 2370N/A * Optimization for large fills. Foutunatly cairo does generate an y-sorted 2370N/A * list of trapezoids. This makes it quite simple to check wether a tile is 2370N/A * fully covered by traps by: - Checking wether the tile is fully covered by 2370N/A * traps vertically (trap 2 starts where trap 1 ended) - Checking wether all 2370N/A * traps cover the tile horizontally This also works, when a single tile 2370N/A // Don't bother optimizing tiles with lots of traps, usually it won't 2370N/A // Check wether first tile covers the beginning of the tile vertically 2370N/A // Initialize lastBottom with top, in order to pass the checks for the 2370N/A // When the last trap covered the tileEnd vertically, the tile is fully