/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "math.h"
#include "GraphicsPrimitiveMgr.h"
#include "LineUtils.h"
#include "Trace.h"
#include "ParallelogramUtils.h"
#include "sun_java2d_loops_DrawParallelogram.h"
do { \
} while (0)
typedef struct {
} EdgeInfo;
do { \
} while (0)
do { \
STORE_EDGE((pLTEDGE)+0, \
STORE_EDGE((pRTEDGE)+0, \
} while (0)
/*
* Class: sun_java2d_loops_DrawParallelogram
* Method: DrawParallelogram
* Signature: (Lsun/java2d/SunGraphics2D;Lsun/java2d/SurfaceData;DDDDDDDD)V
*/
{
/*
* Sort parallelogram by y values, ensure that each delta vector
* has a non-negative y delta.
*/
// dx,dy for line width in the "1" and "2" directions.
// calculate origin of the outer parallelogram
return;
}
}
return;
}
{
return;
}
return;
}
// Only need to generate 4 quads if the interior still
// has a hole in it (i.e. if the line width ratios were
// both less than 1.0)
// If the line widths are both less than a pixel wide
// then we can use a drawline function instead for even
// more performance.
return;
}
// To simplify the edge management below we presort the
// inner and outer edges so that they are globally sorted
// from left to right. If you scan across the array of
// edges for a given Y range then the edges you encounter
// will be sorted in X as well.
// If AB are left top and bottom edges of outer parallelogram,
// and CD are the right pair of edges, and abcd are the
// corresponding inner parallelogram edges then we want them
// sorted as ABabcdCD to ensure this horizontal ordering.
// Conceptually it is like 2 pairs of nested parentheses.
numedges = 8;
} else {
// The line width ratios were large enough to consume
// the entire hole in the middle of the parallelogram
// so we can just issue one large quad for the outer
// parallelogram.
numedges = 4;
}
// The outer parallelogram always goes in the first two
// and last two entries in the array so we either have
// ABabcdCD ordering for 8 edges or ABCD ordering for 4
// edges. See comment above where we store the inner
// parallelogram for a more complete description.
// Maintaining a sorted edge list is probably overkill for
// 4 or 8 edges. The indices chosen above for storing the
// inner and outer left and right edges already guarantee
// left to right ordering so we just need to scan for edges
// that overlap the current Y range (and also determine the
// maximum Y value for which the range is valid).
// This edge is still in play, have we reached it yet?
// This edge is not active (yet)
// Stop before we get to the top of it
} else {
// This edge is active, store it
// And stop when we get to the bottom of it
}
}
}
#ifdef DEBUG
if ((numactive & 1) != 0) {
"DrawParallelogram: "
"ODD NUMBER OF PGRAM EDGES (%d)!!",
}
#endif
}
}
}
}
}