diff options
author | nyamatongwe <devnull@localhost> | 2013-01-27 10:36:21 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-01-27 10:36:21 +1100 |
commit | 6b4e1dc93e6688a1cb61317757012df2d2aac3d2 (patch) | |
tree | c21091759704c1f58bfac1a074089e6a155196f3 /win32 | |
parent | 9a4bac67eb69aaaa550e88d6c466d15a1d9eb310 (diff) | |
download | scintilla-mirror-6b4e1dc93e6688a1cb61317757012df2d2aac3d2.tar.gz |
Check result from CreateDCRenderTarget.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/PlatWin.cxx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index c1cd38f71..f7d68b921 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2462,20 +2462,22 @@ void ListBoxX::Draw(DRAWITEMSTRUCT *pDrawItem) { ); ID2D1DCRenderTarget *pDCRT = 0; HRESULT hr = pD2DFactory->CreateDCRenderTarget(&props, &pDCRT); - RECT rcWindow; - GetClientRect(pDrawItem->hwndItem, &rcWindow); - hr = pDCRT->BindDC(pDrawItem->hDC, &rcWindow); if (SUCCEEDED(hr)) { - surfaceItem->Init(pDCRT, pDrawItem->hwndItem); - pDCRT->BeginDraw(); - int left = pDrawItem->rcItem.left + ItemInset.x + ImageInset.x; - PRectangle rcImage(left, pDrawItem->rcItem.top, - left + images.GetWidth(), pDrawItem->rcItem.bottom); - surfaceItem->DrawRGBAImage(rcImage, - pimage->GetWidth(), pimage->GetHeight(), pimage->Pixels()); - delete surfaceItem; - pDCRT->EndDraw(); - pDCRT->Release(); + RECT rcWindow; + GetClientRect(pDrawItem->hwndItem, &rcWindow); + hr = pDCRT->BindDC(pDrawItem->hDC, &rcWindow); + if (SUCCEEDED(hr)) { + surfaceItem->Init(pDCRT, pDrawItem->hwndItem); + pDCRT->BeginDraw(); + int left = pDrawItem->rcItem.left + ItemInset.x + ImageInset.x; + PRectangle rcImage(left, pDrawItem->rcItem.top, + left + images.GetWidth(), pDrawItem->rcItem.bottom); + surfaceItem->DrawRGBAImage(rcImage, + pimage->GetWidth(), pimage->GetHeight(), pimage->Pixels()); + delete surfaceItem; + pDCRT->EndDraw(); + pDCRT->Release(); + } } #endif } |