/*
* 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 <stdlib.h>
#include "jni_util.h"
#include "Region.h"
#include "sizecalc.h"
do { \
return; \
} \
} while (0)
/*
* Class: sun_java2d_pipe_Region
* Method: initIDs
* Signature: ()V
*/
{
}
{
} else {
}
? NULL
return 0;
}
{
} else {
}
}
{
? NULL
}
{
if (Region_IsEmpty(pRgnInfo)) {
totalrects = 0;
} else if (Region_IsRectangular(pRgnInfo)) {
totalrects = 1;
} else {
int index = 0;
totalrects = 0;
break;
}
while (numrects > 0) {
numrects--;
break;
}
totalrects++;
}
}
}
}
}
return totalrects;
}
{
if (Region_IsRectangular(pRgnInfo)) {
return 0;
}
index = 1;
} else {
while (JNI_TRUE) {
if (numrects <= 0) {
return 0;
}
return 0;
}
}
}
numrects = 0;
continue;
}
}
numrects--;
numrects = 0;
continue;
}
}
}
break;
}
}
}
return 1;
}
{
}
}
/*
* The code was extracted from
* XSetClip() method.
*
* If the region is null, the shape is considered to be
* a rectangle (x1, y1, x2-x1, y2-y1).
*
* The *pRect must point to a buffer of initialBufferSize
* rectangles. If there're more than initialBufferSize
* rectangles in the region, the buffer is reallocated
* and its pointer is being stored at the *pRect. Using
* this practice we may use a small local (on the stack)
* buffer and avoid allocating/freeing a memory if we
* operate simple regions.
*/
{
int i, numrects;
/* empty clip, disable rendering */
numrects = 0;
} else {
numrects = 1;
}
} else {
/* return; REMIND: What to do here? */
}
if ((unsigned long)numrects > initialBufferSize) {
"Can't allocate shape region memory");
return 0;
}
}
}
}
return numrects;
}