Path: blob/master/src/java.desktop/share/native/common/java2d/opengl/OGLVertexCache.h
41159 views
/*1* Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef OGLVertexCache_h_Included26#define OGLVertexCache_h_Included2728#include "j2d_md.h"29#include "OGLContext.h"3031/**32* Constants that control the size of the vertex cache.33*/34#define OGLVC_MAX_INDEX 10243536/**37* Constants that control the size of the texture tile cache used for38* mask operations.39*/40#define OGLVC_MASK_CACHE_TILE_WIDTH 3241#define OGLVC_MASK_CACHE_TILE_HEIGHT 3242#define OGLVC_MASK_CACHE_TILE_SIZE \43(OGLVC_MASK_CACHE_TILE_WIDTH * OGLVC_MASK_CACHE_TILE_HEIGHT)4445#define OGLVC_MASK_CACHE_WIDTH_IN_TILES 846#define OGLVC_MASK_CACHE_HEIGHT_IN_TILES 44748#define OGLVC_MASK_CACHE_WIDTH_IN_TEXELS \49(OGLVC_MASK_CACHE_TILE_WIDTH * OGLVC_MASK_CACHE_WIDTH_IN_TILES)50#define OGLVC_MASK_CACHE_HEIGHT_IN_TEXELS \51(OGLVC_MASK_CACHE_TILE_HEIGHT * OGLVC_MASK_CACHE_HEIGHT_IN_TILES)5253/*54* We reserve one (fully opaque) tile in the upper-right corner for55* operations where the mask is null.56*/57#define OGLVC_MASK_CACHE_MAX_INDEX \58((OGLVC_MASK_CACHE_WIDTH_IN_TILES * OGLVC_MASK_CACHE_HEIGHT_IN_TILES) - 1)59#define OGLVC_MASK_CACHE_SPECIAL_TILE_X \60(OGLVC_MASK_CACHE_WIDTH_IN_TEXELS - OGLVC_MASK_CACHE_TILE_WIDTH)61#define OGLVC_MASK_CACHE_SPECIAL_TILE_Y \62(OGLVC_MASK_CACHE_HEIGHT_IN_TEXELS - OGLVC_MASK_CACHE_TILE_HEIGHT)6364/**65* Exported methods.66*/67jboolean OGLVertexCache_InitVertexCache(OGLContext *oglc);68void OGLVertexCache_FlushVertexCache();69void OGLVertexCache_RestoreColorState(OGLContext *oglc);7071void OGLVertexCache_EnableMaskCache(OGLContext *oglc);72void OGLVertexCache_DisableMaskCache(OGLContext *oglc);73void OGLVertexCache_AddMaskQuad(OGLContext *oglc,74jint srcx, jint srcy,75jint dstx, jint dsty,76jint width, jint height,77jint maskscan, void *mask);7879void OGLVertexCache_AddGlyphQuad(OGLContext *oglc,80jfloat tx1, jfloat ty1,81jfloat tx2, jfloat ty2,82jfloat dx1, jfloat dy1,83jfloat dx2, jfloat dy2);8485#endif /* OGLVertexCache_h_Included */868788