Skip to content

Commit f95346e

Browse files
committed
8299261: Clean up AWT D3D exports
Reviewed-by: serb, aivanov
1 parent 195f313 commit f95346e

File tree

8 files changed

+38
-139
lines changed

8 files changed

+38
-139
lines changed

src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp

+4-74
Original file line numberDiff line numberDiff line change
@@ -55,77 +55,7 @@ extern "C" BlitFunc AnyIntIsomorphicCopy;
5555
extern "C" BlitFunc ByteIndexedToIntArgbConvert;
5656
extern "C" BlitFunc ByteIndexedToIntArgbPreConvert;
5757

58-
#define GETMIN(v1, v2) (((v1) > (t=(v2))) && ((v1) = t))
59-
#define GETMAX(v1, v2) (((v1) < (t=(v2))) && ((v1) = t))
60-
61-
#ifdef D3D_PPL_DLL
62-
63-
JNIEXPORT void JNICALL
64-
SurfaceData_IntersectBounds(SurfaceDataBounds *dst, SurfaceDataBounds *src)
65-
{
66-
int t;
67-
GETMAX(dst->x1, src->x1);
68-
GETMAX(dst->y1, src->y1);
69-
GETMIN(dst->x2, src->x2);
70-
GETMIN(dst->y2, src->y2);
71-
}
72-
73-
JNIEXPORT void JNICALL
74-
SurfaceData_IntersectBoundsXYXY(SurfaceDataBounds *bounds,
75-
jint x1, jint y1, jint x2, jint y2)
76-
{
77-
int t;
78-
GETMAX(bounds->x1, x1);
79-
GETMAX(bounds->y1, y1);
80-
GETMIN(bounds->x2, x2);
81-
GETMIN(bounds->y2, y2);
82-
}
83-
84-
JNIEXPORT void JNICALL
85-
SurfaceData_IntersectBoundsXYWH(SurfaceDataBounds *bounds,
86-
jint x, jint y, jint w, jint h)
87-
{
88-
w = (w <= 0) ? x : x+w;
89-
if (w < x) {
90-
w = 0x7fffffff;
91-
}
92-
if (bounds->x1 < x) {
93-
bounds->x1 = x;
94-
}
95-
if (bounds->x2 > w) {
96-
bounds->x2 = w;
97-
}
98-
h = (h <= 0) ? y : y+h;
99-
if (h < y) {
100-
h = 0x7fffffff;
101-
}
102-
if (bounds->y1 < y) {
103-
bounds->y1 = y;
104-
}
105-
if (bounds->y2 > h) {
106-
bounds->y2 = h;
107-
}
108-
}
109-
110-
JNIEXPORT void JNICALL
111-
SurfaceData_IntersectBlitBounds(SurfaceDataBounds *src,
112-
SurfaceDataBounds *dst,
113-
jint dx, jint dy)
114-
{
115-
int t;
116-
GETMAX(dst->x1, src->x1 + dx);
117-
GETMAX(dst->y1, src->y1 + dy);
118-
GETMIN(dst->x2, src->x2 + dx);
119-
GETMIN(dst->y2, src->y2 + dy);
120-
GETMAX(src->x1, dst->x1 - dx);
121-
GETMAX(src->y1, dst->y1 - dy);
122-
GETMIN(src->x2, dst->x2 - dx);
123-
GETMIN(src->y2, dst->y2 - dy);
124-
}
125-
126-
#endif /* D3D_PPL_DLL */
127-
128-
D3DPIPELINE_API HRESULT
58+
HRESULT
12959
D3DBL_CopySurfaceToIntArgbImage(IDirect3DSurface9 *pSurface,
13060
SurfaceDataRasInfo *pDstInfo,
13161
jint srcx, jint srcy,
@@ -199,7 +129,7 @@ D3DBL_CopySurfaceToIntArgbImage(IDirect3DSurface9 *pSurface,
199129
return pSurface->UnlockRect();
200130
}
201131

202-
D3DPIPELINE_API HRESULT
132+
HRESULT
203133
D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
204134
int srctype,
205135
D3DResource *pDstSurfaceRes,
@@ -558,7 +488,7 @@ D3DBlitTextureToSurface(D3DContext *d3dc,
558488
* into the appropriate location in the destination surface.
559489
*
560490
*/
561-
D3DPIPELINE_API HRESULT
491+
HRESULT
562492
D3DBlitToSurfaceViaTexture(D3DContext *d3dc, SurfaceDataRasInfo *srcInfo,
563493
int srctype, D3DSDOps *srcOps,
564494
jboolean swsurface, jint hint,
@@ -687,7 +617,7 @@ D3DBlitSwToTexture(D3DContext *d3dc,
687617
* Surface->Surface inner loops will be invoked, depending on the transform
688618
* state.
689619
*/
690-
D3DPIPELINE_API HRESULT
620+
HRESULT
691621
D3DBlitLoops_IsoBlit(JNIEnv *env,
692622
D3DContext *d3dc, jlong pSrcOps, jlong pDstOps,
693623
jboolean xform, jint hint,

src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define OFFSET_XFORM sun_java2d_d3d_D3DBlitLoops_OFFSET_XFORM
3838
#define OFFSET_ISOBLIT sun_java2d_d3d_D3DBlitLoops_OFFSET_ISOBLIT
3939

40-
D3DPIPELINE_API HRESULT
40+
HRESULT
4141
D3DBlitLoops_IsoBlit(JNIEnv *env,
4242
D3DContext *d3dc, jlong pSrcOps, jlong pDstOps,
4343
jboolean xform, jint hint,
@@ -47,14 +47,14 @@ D3DBlitLoops_IsoBlit(JNIEnv *env,
4747
jdouble dx1, jdouble dy1,
4848
jdouble dx2, jdouble dy2);
4949

50-
D3DPIPELINE_API HRESULT
50+
HRESULT
5151
D3DBL_CopySurfaceToIntArgbImage(IDirect3DSurface9 *pSurface,
5252
SurfaceDataRasInfo *pDstInfo,
5353
jint srcx, jint srcy,
5454
jint srcWidth, jint srcHeight,
5555
jint dstx, jint dsty);
5656

57-
D3DPIPELINE_API HRESULT
57+
HRESULT
5858
D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
5959
int srctype,
6060
D3DResource *pDstSurfaceRes,

src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class D3DGlyphCache;
106106
* - holds a glyph cache texture for the associated device
107107
* - implements primitives batching mechanism
108108
*/
109-
class D3DPIPELINE_API D3DContext {
109+
class D3DContext {
110110
public:
111111
/**
112112
* Releases the old device (if there was one) and all associated

src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipeline.h

+8-35
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,16 @@
2828
#define D3D_DEBUG_INFO
2929
#endif // DEBUG
3030

31-
#ifdef D3D_PPL_DLL
31+
// this include ensures that with debug build we get
32+
// awt's overridden debug "new" and "delete" operators
33+
#include "awt.h"
3234

35+
#include <windows.h>
36+
#include <d3d9.h>
37+
#include "Trace.h"
3338

34-
#ifndef WIN32_LEAN_AND_MEAN
35-
#define WIN32_LEAN_AND_MEAN
36-
#endif
37-
38-
#ifdef D3DPIPELINE_EXPORTS
39-
#define D3DPIPELINE_API __declspec(dllexport)
40-
#else
41-
#define D3DPIPELINE_API __declspec(dllimport)
42-
#endif
43-
44-
#include <windows.h>
45-
#include <d3d9.h>
46-
#include <DDErr.h>
47-
#include "..\Import\Trace.h"
48-
49-
#define DebugPrintD3DError(res, msg) \
50-
DXTRACE_ERR(msg, res)
51-
52-
#else
53-
54-
#define D3DPIPELINE_API __declspec(dllexport)
55-
56-
// this include ensures that with debug build we get
57-
// awt's overridden debug "new" and "delete" operators
58-
#include "awt.h"
59-
60-
#include <windows.h>
61-
#include <d3d9.h>
62-
#include "Trace.h"
63-
64-
#define DebugPrintD3DError(res, msg) \
65-
J2dTraceLn1(J2D_TRACE_ERROR, "D3D Error: " msg " res=%d", res)
66-
67-
#endif /*D3D_PPL_DLL*/
39+
#define DebugPrintD3DError(res, msg) \
40+
J2dTraceLn1(J2D_TRACE_ERROR, "D3D Error: " msg " res=%d", res)
6841

6942
// some helper macros
7043
#define SAFE_RELEASE(RES) \

src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ typedef struct D3DAdapter
3737
HWND fsFocusWindow;
3838
} D3DAdapter;
3939

40-
class D3DPIPELINE_API D3DPipelineManager
40+
class D3DPipelineManager
4141
{
4242
friend class D3DInitializer;
4343
private:

src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderer.cpp

+10-14
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "D3DRenderer.h"
3232
#include "D3DRenderQueue.h"
3333

34-
HRESULT D3DPIPELINE_API
34+
HRESULT
3535
D3DRenderer_DrawLine(D3DContext *d3dc,
3636
jint x1, jint y1, jint x2, jint y2)
3737
{
@@ -42,7 +42,7 @@ D3DRenderer_DrawLine(D3DContext *d3dc,
4242
return d3dc->pVCacher->DrawLine(x1, y1, x2, y2);
4343
}
4444

45-
HRESULT D3DPIPELINE_API
45+
HRESULT
4646
D3DRenderer_DrawRect(D3DContext *d3dc,
4747
jint x, jint y, jint w, jint h)
4848
{
@@ -54,7 +54,7 @@ D3DRenderer_DrawRect(D3DContext *d3dc,
5454
return d3dc->pVCacher->DrawRect(x, y, x + w, y + h);
5555
}
5656

57-
HRESULT D3DPIPELINE_API
57+
HRESULT
5858
D3DRenderer_FillRect(D3DContext *d3dc,
5959
jint x, jint y, jint w, jint h)
6060
{
@@ -66,7 +66,7 @@ D3DRenderer_FillRect(D3DContext *d3dc,
6666
return d3dc->pVCacher->FillRect(x, y, x + w, y + h);
6767
}
6868

69-
HRESULT D3DPIPELINE_API
69+
HRESULT
7070
D3DRenderer_DrawPoly(D3DContext *d3dc,
7171
jint nPoints, jboolean isClosed,
7272
jint transX, jint transY,
@@ -85,7 +85,7 @@ D3DRenderer_DrawPoly(D3DContext *d3dc,
8585
xPoints, yPoints);
8686
}
8787

88-
HRESULT D3DPIPELINE_API
88+
HRESULT
8989
D3DRenderer_DrawScanlines(D3DContext *d3dc,
9090
jint scanlineCount, jint *scanlines)
9191
{
@@ -102,7 +102,7 @@ D3DRenderer_DrawScanlines(D3DContext *d3dc,
102102
return d3dc->pVCacher->DrawScanlines(scanlineCount, scanlines);
103103
}
104104

105-
HRESULT D3DPIPELINE_API
105+
HRESULT
106106
D3DRenderer_FillSpans(D3DContext *d3dc, jint spanCount, jint *spans)
107107
{
108108
J2dTraceLn(J2D_TRACE_INFO, "D3DRenderer_FillSpans");
@@ -114,7 +114,7 @@ D3DRenderer_FillSpans(D3DContext *d3dc, jint spanCount, jint *spans)
114114
return d3dc->pVCacher->FillSpans(spanCount, spans);
115115
}
116116

117-
HRESULT D3DPIPELINE_API
117+
HRESULT
118118
D3DRenderer_FillParallelogram(D3DContext *d3dc,
119119
jfloat fx11, jfloat fy11,
120120
jfloat dx21, jfloat dy21,
@@ -135,7 +135,7 @@ D3DRenderer_FillParallelogram(D3DContext *d3dc,
135135
dx12, dy12);
136136
}
137137

138-
HRESULT D3DPIPELINE_API
138+
HRESULT
139139
D3DRenderer_DrawParallelogram(D3DContext *d3dc,
140140
jfloat fx11, jfloat fy11,
141141
jfloat dx21, jfloat dy21,
@@ -242,7 +242,7 @@ D3DRenderer_DrawParallelogram(D3DContext *d3dc,
242242
return res;
243243
}
244244

245-
HRESULT D3DPIPELINE_API
245+
HRESULT
246246
D3DRenderer_FillAAParallelogram(D3DContext *d3dc,
247247
jfloat fx11, jfloat fy11,
248248
jfloat dx21, jfloat dy21,
@@ -274,7 +274,7 @@ D3DRenderer_FillAAParallelogram(D3DContext *d3dc,
274274
return res;
275275
}
276276

277-
HRESULT D3DPIPELINE_API
277+
HRESULT
278278
D3DRenderer_DrawAAParallelogram(D3DContext *d3dc,
279279
jfloat fx11, jfloat fy11,
280280
jfloat dx21, jfloat dy21,
@@ -349,8 +349,6 @@ D3DRenderer_DrawAAParallelogram(D3DContext *d3dc,
349349
return res;
350350
}
351351

352-
#ifndef D3D_PPL_DLL
353-
354352
extern "C"
355353
{
356354

@@ -388,5 +386,3 @@ Java_sun_java2d_d3d_D3DRenderer_drawPoly
388386
}
389387

390388
}
391-
392-
#endif // D3D_PPL_DLL

src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderer.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -33,51 +33,51 @@
3333
#define BYTES_PER_SPAN \
3434
sun_java2d_pipe_BufferedRenderPipe_BYTES_PER_SPAN
3535

36-
HRESULT D3DPIPELINE_API
36+
HRESULT
3737
D3DRenderer_DrawLine(D3DContext *d3dc,
3838
jint x1, jint y1, jint x2, jint y2);
3939

40-
HRESULT D3DPIPELINE_API
40+
HRESULT
4141
D3DRenderer_DrawRect(D3DContext *d3dc,
4242
jint x, jint y, jint w, jint h);
4343

44-
HRESULT D3DPIPELINE_API
44+
HRESULT
4545
D3DRenderer_FillRect(D3DContext *d3dc,
4646
jint x, jint y, jint w, jint h);
4747

48-
HRESULT D3DPIPELINE_API
48+
HRESULT
4949
D3DRenderer_DrawPoly(D3DContext *d3dc,
5050
jint nPoints, jboolean isClosed,
5151
jint transX, jint transY,
5252
jint *xPoints, jint *yPoints);
5353

54-
HRESULT D3DPIPELINE_API
54+
HRESULT
5555
D3DRenderer_DrawScanlines(D3DContext *d3dc,
5656
jint scanlineCount, jint *scanlines);
5757

58-
HRESULT D3DPIPELINE_API
58+
HRESULT
5959
D3DRenderer_FillSpans(D3DContext *d3dc, jint spanCount, jint *spans);
6060

61-
HRESULT D3DPIPELINE_API
61+
HRESULT
6262
D3DRenderer_FillParallelogram(D3DContext *d3dc,
6363
jfloat fx11, jfloat fy11,
6464
jfloat dx21, jfloat dy21,
6565
jfloat dx12, jfloat dy12);
6666

67-
HRESULT D3DPIPELINE_API
67+
HRESULT
6868
D3DRenderer_DrawParallelogram(D3DContext *d3dc,
6969
jfloat fx11, jfloat fy11,
7070
jfloat dx21, jfloat dy21,
7171
jfloat dx12, jfloat dy12,
7272
jfloat lw21, jfloat lw12);
7373

74-
HRESULT D3DPIPELINE_API
74+
HRESULT
7575
D3DRenderer_FillAAParallelogram(D3DContext *d3dc,
7676
jfloat fx11, jfloat fy11,
7777
jfloat dx21, jfloat dy21,
7878
jfloat dx12, jfloat dy12);
7979

80-
HRESULT D3DPIPELINE_API
80+
HRESULT
8181
D3DRenderer_DrawAAParallelogram(D3DContext *d3dc,
8282
jfloat fx11, jfloat fy11,
8383
jfloat dx21, jfloat dy21,

src/java.desktop/windows/native/libawt/java2d/d3d/D3DVertexCacher.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef struct {
4949

5050
class D3DContext;
5151

52-
class D3DPIPELINE_API D3DVertexCacher {
52+
class D3DVertexCacher {
5353
public:
5454
HRESULT Init(D3DContext *pCtx);
5555
~D3DVertexCacher() { ReleaseDefPoolResources(); }

0 commit comments

Comments
 (0)