Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/windows/native/sun/java2d/d3d/D3DMaskCache.h
32288 views
/*1* Copyright (c) 2007, 2008, 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 D3DMASKCACHE_H26#define D3DMASKCACHE_H2728#include "jni.h"29#include "D3DContext.h"3031/**32* Constants that control the size of the texture tile cache used for33* mask operations.34*/35#define D3D_MASK_CACHE_TILE_WIDTH 3236#define D3D_MASK_CACHE_TILE_HEIGHT 3237#define D3D_MASK_CACHE_TILE_SIZE \38(D3D_MASK_CACHE_TILE_WIDTH * D3D_MASK_CACHE_TILE_HEIGHT)3940#define D3D_MASK_CACHE_WIDTH_IN_TILES 841#define D3D_MASK_CACHE_HEIGHT_IN_TILES 44243#define D3D_MASK_CACHE_WIDTH_IN_TEXELS \44(D3D_MASK_CACHE_TILE_WIDTH * D3D_MASK_CACHE_WIDTH_IN_TILES)45#define D3D_MASK_CACHE_HEIGHT_IN_TEXELS \46(D3D_MASK_CACHE_TILE_HEIGHT * D3D_MASK_CACHE_HEIGHT_IN_TILES)4748/*49* We reserve one (fully opaque) tile in the upper-right corner for50* operations where the mask is null.51*/52#define D3D_MASK_CACHE_MAX_INDEX \53((D3D_MASK_CACHE_WIDTH_IN_TILES * D3D_MASK_CACHE_HEIGHT_IN_TILES) - 1)54#define D3D_MASK_CACHE_SPECIAL_TILE_X \55(D3D_MASK_CACHE_WIDTH_IN_TEXELS - D3D_MASK_CACHE_TILE_WIDTH)56#define D3D_MASK_CACHE_SPECIAL_TILE_Y \57(D3D_MASK_CACHE_HEIGHT_IN_TEXELS - D3D_MASK_CACHE_TILE_HEIGHT)5859class D3DContext;6061class D3DMaskCache {62public:63HRESULT Init(D3DContext *pCtx);64void ReleaseDefPoolResources() {};65~D3DMaskCache();66HRESULT Enable();67HRESULT Disable();68HRESULT AddMaskQuad(int srcx, int srcy,69int dstx, int dsty,70int width, int height,71int maskscan, void *mask);7273static74HRESULT CreateInstance(D3DContext *pCtx, D3DMaskCache **ppMaskCache);7576private:77D3DMaskCache();78UINT maskCacheIndex;79D3DContext *pCtx;80};8182#endif // D3DMASKCACHE_H838485