Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
brcolow committed Aug 27, 2018
1 parent b5fb55f commit e8b73bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions buildSrc/win.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if (!WIN.canBuild) return;
WIN.compileSwing = true;
WIN.compileSWT = true;

WIN.includeMonocle = true;
WIN.includeNull3d = true

// Lambda for naming the generated libs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ static final native int GetGlyphPlacements(long ptr,

//IWICImagingFactory
static final native long CreateBitmap(long ptr, int uiWidth, int uiHeight, int pixelFormat, int options);
static final native void UninitializeCOM(long ptr);

//IWICBitmap
static final native long Lock(long ptr, int x, int y, int width, int height, int flags);
Expand Down
16 changes: 4 additions & 12 deletions modules/javafx.graphics/src/main/native-font/directwrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,27 +848,19 @@ jobject newD2D1_MATRIX_3X2_F(JNIEnv *env, D2D1_MATRIX_3X2_F *lpStruct)
JNIEXPORT jlong JNICALL OS_NATIVE(_1WICCreateImagingFactory)
(JNIEnv *env, jclass that)
{
/* This routine initialize COM in order to create an WICImagingFactory.
* It runs on the prism thread and expects no other codes in this thread
* to interface with COM.
/* COM will already be initialized for the lifespan of the application
* via WinApplication OLE initialization. Therefore we can just create
* the IWICImagingFactory directly.
* Note: This method is called by DWFactory a single time.
*/
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);

/* This means COM has been initialize with a different concurrency model.
* This should never happen. */
if (hr == RPC_E_CHANGED_MODE) return NULL;

IWICImagingFactory* result = NULL;
hr = CoCreateInstance(
HRESULT hr = CoCreateInstance(
CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&result)
);

/* Unload COM as no other COM objects will be create directly */
CoUninitialize();
return SUCCEEDED(hr) ? (jlong)result : NULL;
}

Expand Down

0 comments on commit e8b73bc

Please sign in to comment.