0N/A/*
2362N/A * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/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
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#ifndef OGLVertexCache_h_Included
0N/A#define OGLVertexCache_h_Included
0N/A
0N/A#include "j2d_md.h"
0N/A#include "OGLContext.h"
0N/A
0N/A/**
0N/A * Constants that control the size of the vertex cache.
0N/A */
0N/A#define OGLVC_MAX_INDEX 1024
0N/A
0N/A/**
0N/A * Constants that control the size of the texture tile cache used for
0N/A * mask operations.
0N/A */
0N/A#define OGLVC_MASK_CACHE_TILE_WIDTH 32
0N/A#define OGLVC_MASK_CACHE_TILE_HEIGHT 32
0N/A#define OGLVC_MASK_CACHE_TILE_SIZE \
0N/A (OGLVC_MASK_CACHE_TILE_WIDTH * OGLVC_MASK_CACHE_TILE_HEIGHT)
0N/A
0N/A#define OGLVC_MASK_CACHE_WIDTH_IN_TILES 8
0N/A#define OGLVC_MASK_CACHE_HEIGHT_IN_TILES 4
0N/A
0N/A#define OGLVC_MASK_CACHE_WIDTH_IN_TEXELS \
0N/A (OGLVC_MASK_CACHE_TILE_WIDTH * OGLVC_MASK_CACHE_WIDTH_IN_TILES)
0N/A#define OGLVC_MASK_CACHE_HEIGHT_IN_TEXELS \
0N/A (OGLVC_MASK_CACHE_TILE_HEIGHT * OGLVC_MASK_CACHE_HEIGHT_IN_TILES)
0N/A
0N/A/*
0N/A * We reserve one (fully opaque) tile in the upper-right corner for
0N/A * operations where the mask is null.
0N/A */
0N/A#define OGLVC_MASK_CACHE_MAX_INDEX \
0N/A ((OGLVC_MASK_CACHE_WIDTH_IN_TILES * OGLVC_MASK_CACHE_HEIGHT_IN_TILES) - 1)
0N/A#define OGLVC_MASK_CACHE_SPECIAL_TILE_X \
0N/A (OGLVC_MASK_CACHE_WIDTH_IN_TEXELS - OGLVC_MASK_CACHE_TILE_WIDTH)
0N/A#define OGLVC_MASK_CACHE_SPECIAL_TILE_Y \
0N/A (OGLVC_MASK_CACHE_HEIGHT_IN_TEXELS - OGLVC_MASK_CACHE_TILE_HEIGHT)
0N/A
0N/A/**
0N/A * Exported methods.
0N/A */
5040N/Ajboolean OGLVertexCache_InitVertexCache(OGLContext *oglc);
0N/Avoid OGLVertexCache_FlushVertexCache();
0N/Avoid OGLVertexCache_RestoreColorState(OGLContext *oglc);
0N/A
0N/Avoid OGLVertexCache_EnableMaskCache(OGLContext *oglc);
0N/Avoid OGLVertexCache_DisableMaskCache(OGLContext *oglc);
0N/Avoid OGLVertexCache_AddMaskQuad(OGLContext *oglc,
0N/A jint srcx, jint srcy,
0N/A jint dstx, jint dsty,
0N/A jint width, jint height,
0N/A jint maskscan, void *mask);
0N/A
0N/Avoid OGLVertexCache_AddGlyphQuad(OGLContext *oglc,
0N/A jfloat tx1, jfloat ty1,
0N/A jfloat tx2, jfloat ty2,
0N/A jfloat dx1, jfloat dy1,
0N/A jfloat dx2, jfloat dy2);
0N/A
0N/A#endif /* OGLVertexCache_h_Included */