Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/windows/native/sun/java2d/d3d/D3DPaints.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 D3DPaints_h_Included26#define D3DPaints_h_Included2728#include "sun_java2d_SunGraphics2D.h"2930#include "D3DContext.h"31#include "D3DSurfaceData.h"3233HRESULT D3DPaints_ResetPaint(D3DContext *d3dc);34HRESULT D3DPaints_SetColor(D3DContext *d3dc, jint pixel);3536/************************* GradientPaint support ****************************/3738/**39* Flags that can be bitwise-or'ed together to control how the shader40* source code is generated.41*/42#define BASIC_GRAD_IS_CYCLIC (1 << 0)43#define BASIC_GRAD_USE_MASK (1 << 1)4445HRESULT D3DPaints_SetGradientPaint(D3DContext *d3dc,46jboolean useMask, jboolean cyclic,47jdouble p0, jdouble p1, jdouble p3,48jint pixel1, jint pixel2);4950/************************** TexturePaint support ****************************/5152HRESULT D3DPaints_SetTexturePaint(D3DContext *d3dc,53jboolean useMask,54jlong pSrcOps, jboolean filter,55jdouble xp0, jdouble xp1, jdouble xp3,56jdouble yp0, jdouble yp1, jdouble yp3);5758/****************** Shared MultipleGradientPaint support ********************/5960/**61* These constants are identical to those defined in the62* MultipleGradientPaint.CycleMethod enum; they are copied here for63* convenience (ideally we would pull them directly from the Java level,64* but that entails more hassle than it is worth).65*/66#define CYCLE_NONE 067#define CYCLE_REFLECT 168#define CYCLE_REPEAT 26970/**71* The following constants are flags that can be bitwise-or'ed together72* to control how the MultipleGradientPaint shader source code is generated:73*74* MULTI_GRAD_CYCLE_METHOD75* Placeholder for the CycleMethod enum constant.76*77* MULTI_GRAD_LARGE78* If set, use the (slower) shader that supports a larger number of79* gradient colors; otherwise, use the optimized codepath. See80* the MAX_FRACTIONS_SMALL/LARGE constants below for more details.81*82* MULTI_GRAD_USE_MASK83* If set, apply the alpha mask value from texture unit 1 to the84* final color result (only used in the MaskFill case).85*86* MULTI_GRAD_LINEAR_RGB87* If set, convert the linear RGB result back into the sRGB color space.88*/89#define MULTI_GRAD_CYCLE_METHOD (3 << 0)90#define MULTI_GRAD_LARGE (1 << 2)91#define MULTI_GRAD_USE_MASK (1 << 3)92#define MULTI_GRAD_LINEAR_RGB (1 << 4)9394/**95* The maximum number of gradient colors supported by all of the gradient96* fragment shaders. Note that this value must be a power of two, as it97* determines the size of the 1D texture created below. It also must be98* greater than or equal to MAX_FRACTIONS (there is no strict requirement99* that the two values be equal).100*/101#define MAX_MULTI_GRADIENT_COLORS 16102103/********************** LinearGradientPaint support *************************/104105HRESULT D3DPaints_SetLinearGradientPaint(D3DContext *d3dc, D3DSDOps *dstOps,106jboolean useMask, jboolean linear,107jint cycleMethod, jint numStops,108jfloat p0, jfloat p1, jfloat p3,109void *fractions, void *pixels);110111/********************** RadialGradientPaint support *************************/112113HRESULT D3DPaints_SetRadialGradientPaint(D3DContext *d3dc, D3DSDOps *dstOps,114jboolean useMask, jboolean linear,115jint cycleMethod, jint numStops,116jfloat m00, jfloat m01, jfloat m02,117jfloat m10, jfloat m11, jfloat m12,118jfloat focusX,119void *fractions, void *pixels);120121/************************ SunGraphics2D constants ***************************/122123#define PAINT_CUSTOM sun_java2d_SunGraphics2D_PAINT_CUSTOM124#define PAINT_TEXTURE sun_java2d_SunGraphics2D_PAINT_TEXTURE125#define PAINT_RAD_GRADIENT sun_java2d_SunGraphics2D_PAINT_RAD_GRADIENT126#define PAINT_LIN_GRADIENT sun_java2d_SunGraphics2D_PAINT_LIN_GRADIENT127#define PAINT_GRADIENT sun_java2d_SunGraphics2D_PAINT_GRADIENT128#define PAINT_ALPHACOLOR sun_java2d_SunGraphics2D_PAINT_ALPHACOLOR129#define PAINT_OPAQUECOLOR sun_java2d_SunGraphics2D_PAINT_OPAQUECOLOR130131#endif /* D3DPaints_h_Included */132133134