2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. 430N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 430N/A * This code is free software; you can redistribute it and/or modify it 430N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 430N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 430N/A * This code is distributed in the hope that it will be useful, but WITHOUT 430N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 430N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 430N/A * version 2 for more details (a copy is included in the LICENSE file that 430N/A * accompanied this code). 430N/A * You should have received a copy of the GNU General Public License version 430N/A * 2 along with this work; if not, write to the Free Software Foundation, 430N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 430N/A// non-texturized macros 430N/A// These are fudge factors for rendering lines found by experimenting. 430N/A// They are used to tweak the geometry such that the rendering (mostly) matches 430N/A// our software rendering on most hardware. The main goal was to pick the 430N/A// numbers such that the beginning and ending pixels of lines match. 430N/A// For the record: value below (or larger) is required for Intel 855, but 430N/A// breaks Nvidia, ATI and Intel 965, and since the pipeline is disabled on 430N/A// 855 anyway we'll use 0.51f. 430N/A//#define HV_FF2 ( 0.5315f) 430N/A// For the record: with this value diagonal-down lines with Texture paint 430N/A// are a bit off on all chipsets but Intel 965. So instead we'll use 430N/A// .304f which makes it better for the rest, but at a price of a bit 430N/A//#define DD_FY2 ( 0.4f) 430N/A // usage depends on whether we use hw or sw vertex processing 430N/A // single point, offset a little so that a single 430N/A // v or / - leave as is 430N/A // npoints is exactly the number of vertices we need, 430N/A // possibly plus one (if the path is closed) 430N/A // leave room for one possible additional closing point 430N/A // include the last point from the current batch into the next 430N/A // if this was the last batch, see if the closing point is needed; 430N/A // note that we have left the room for it 430N/A // for clarity, the loop is ended anyway 430N/A // - either we went nowhere, then change the last point 430N/A // so that a single pixel is rendered 430N/A // - or it's not empty and not closed - add another 430N/A // point because on some boards the last point is not rendered 430N/A // horiz: top left - top right 430N/A // horiz: bottom left - bottom right 430N/A // vert : top right - bottom right 430N/A // vert : top left - bottom left 430N/A 0.0f,
0.0f,
1.0f,
0.0f,
0.0f,
1.0f,
430N/A 0.0f,
1.0f,
1.0f,
0.0f,
1.0f,
1.0f,
430N/A // correct texel to pixel mapping; see D3DContext::SetTransform() 430N/A 0.0f,
0.0f,
1.0f,
0.0f,
0.0f,
1.0f,
430N/A 0.0f,
1.0f,
1.0f,
0.0f,
1.0f,
1.0f,
430N/A// Invert the following transform: 430N/A// DeltaT(0, 0) == (0, 0) 430N/A// DeltaT(1, 0) == (DX1, DY1) 430N/A// DeltaT(0, 1) == (DX2, DY2) 430N/A// DeltaT(1, 1) == (DX1+DX2, DY1+DY2) 430N/A// TM00 = DX1, TM01 = DX2, (TM02 = X11) 430N/A// TM10 = DY1, TM11 = DY2, (TM12 = Y11) 430N/A// Determinant = TM00*TM11 - TM01*TM10 430N/A// IM02 = (TM01 * TM12 - TM11 * TM02) / det, 430N/A// IM12 = (TM10 * TM02 - TM00 * TM12) / det, 430N/A 5.0,
5.0,
6.0,
5.0,
5.0,
6.0,
430N/A 5.0,
6.0,
6.0,
5.0,
6.0,
6.0,
430N/A // inner parallelogram is degenerate 430N/A // therefore it encloses no area 430N/A // correct texel to pixel mapping; see D3DContext::SetTransform() 430N/A // correct texel to pixel mapping; see D3DContext::SetTransform() 430N/A // no data in the buffer yet, we don't care about 430N/A // vertex buffer's contents 430N/A // append to the existing data in the vertex buffer 430N/A // copy only new vertices 430N/A "D3DVC::Render Starting flushing of %d vertices "\
430N/A // the macro for adding a line segment adds one too many prims 430N/A // init to something it can never be 430N/A // REMIND: may need to rethink what to do in case of an error, 430N/A // should we try to render them later? 430N/A // REMIND: need to define our own errors 430N/A // if we can't fit new vertices in the vertex buffer, 430N/A // render whatever we have in the buffer and start 430N/A // from the beginning of the vertex buffer 430N/A "D3DVC::EnsureCapacity exceeded capacity. "\
430N/A "current v: %d, requested vertices: %d\n",
430N/A "D3DVC::EnsureCapacity current batch: %d "\
430N/A // there should not be multiple linestrips in a batch, 430N/A // or they will be counted as a single line strip 430N/A // if this is a first unused batch, use it 430N/A // record the first batch and vertex scheduled for rendering 430N/A // otherwise go to the next batch 430N/A // firstUnusedVertex is updated when new vertices are added 430N/A // to the vertices array