[OpenJDK 2D-Dev] [14] RFR JDK-8235147: Release HDC from passiveDCList sooner

Alexey Ivanov alexey.ivanov at oracle.com
Wed Dec 4 14:06:08 UTC 2019


On 04/12/2019 02:29, Sergey Bylokhov wrote:
> On 12/2/19 2:45 am, Alexey Ivanov wrote:
>> We can have two different functions though:
>> ReleaseActiveDCs(HWND);
>> ReleasePassiveDCs();> Then we can drop the list parameter.
>> What do you think?
>
> Yes, it is worth to try.
>
> BTW it would be good to know do we really need passiveDCList, which
> is populated on "WM_AWT_RELEASEDC" and immediately cleaned.

Yes, we still need passiveDCList. A DC can be moved to the passive list 
by DisposeThreadGraphicsInfo function in GDIWindowSurfaceData.cpp. This 
is called not on the toolkit thread, so we have to defer releasing the 
DC in this case.

However, I agree, we can simplify releasing DCs when on the toolkit 
thread by skipping the passive list. Yet having two different approaches 
could be error prone.

-- 
Regards,
Alexey


More information about the 2d-dev mailing list