Changeset 208013 in webkit
- Timestamp:
- Oct 27, 2016 3:37:21 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r208011 r208013 1 2016-10-27 Per Arne Vollan <pvollan@apple.com> 2 3 [Win][Direct2D] Implement GraphicsContext::releaseWindowsContext. 4 https://bugs.webkit.org/show_bug.cgi?id=163988 5 6 Reviewed by Brent Fulgham. 7 8 This method is needed to draw native controls. 9 10 * platform/graphics/win/GraphicsContextDirect2D.cpp: 11 (WebCore::GraphicsContext::releaseWindowsContext): 12 1 13 2016-10-27 Joseph Pecoraro <pecoraro@apple.com> 2 14 -
trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp
r207863 r208013 258 258 void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap) 259 259 { 260 bool createdBitmap = mayCreateBitmap && (!m_data->m_hdc || isInTransparencyLayer()); 261 if (!createdBitmap) { 262 m_data->restore(); 263 return; 264 } 265 266 if (!hdc || dstRect.isEmpty()) 267 return; 268 269 auto sourceBitmap = adoptGDIObject(static_cast<HBITMAP>(::GetCurrentObject(hdc, OBJ_BITMAP))); 270 271 DIBPixelData pixelData(sourceBitmap.get()); 272 ASSERT(pixelData.bitsPerPixel() == 32); 273 274 auto bitmapProperties = D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE)); 275 276 COMPtr<ID2D1Bitmap> bitmap; 277 HRESULT hr = platformContext()->CreateBitmap(pixelData.size(), pixelData.buffer(), pixelData.bytesPerRow(), &bitmapProperties, &bitmap); 278 ASSERT(SUCCEEDED(hr)); 279 280 if (!didBeginDraw()) 281 platformContext()->BeginDraw(); 282 283 platformContext()->DrawBitmap(bitmap.get(), dstRect); 284 285 if (!didBeginDraw()) 286 hr = platformContext()->EndDraw(); 287 288 ::DeleteDC(hdc); 260 289 } 261 290
Note: See TracChangeset
for help on using the changeset viewer.