Commit Graph

21 Commits

Author SHA1 Message Date
Alex Maitland 837f6ec7a6 WPF - CompositionTargetRenderHandler add null check 2022-04-20 12:15:30 +10:00
Alex Maitland 3b1c46aab9 Code Cleanup - Minor code cleanup
- Add Microsoft.CodeAnalysis.NetAnalyzers package
- Make some classes sealed
- Fix/Add xml doc
2022-02-01 14:07:01 +10:00
amaitland 049172fbba WPF - CompositionTargetRenderHandler improve Dispose 2020-10-31 09:25:07 +10:00
amaitland 839e6ceee4 WPF - Resize Glitches (Image glitches during resize)
- WritableBitmapRenderHandler/InteropBitmapRenderHandler ignore update if size doesn't match
- Revert back to using WritableBitmapRenderHandler as the default implementation
- CompositionTargetRenderHandler only update bitmap if buffer is dirty
- AllocHGlobalWritableBitmapRenderHandler only update bitmap if buffer is dirty

It's possible that OnPaint is called multiple times before our BeginInvoke call is marshalled onto the UI Thread.
In those cases we check width/height and ignore the call if it doesn't match

Issue #3114
2020-10-30 14:51:12 +10:00
amaitland fb289d49d8 WPF - Add AllocHGlobalWritableBitmapRenderHandler
A port of WritableBitmapRenderHandler to use Marshal.AllocHGlobal instead of MemoryMappedFile

Remove disable-gpu-compositing command line arg

Resovles #3114
2020-10-28 15:39:33 +10:00
amaitland 59b8e7fbdd WPF - Default to using WritableBitmapRenderHandler for DPI 100%
- No longer use InteropBitmapRenderHandler as the default (InteropBitmap doesn't support DPI scaling).
- Remove old IncreaseBufferInteropRenderHandler as reusing the buffer causing glitching as detailed in https://github.com/cefsharp/CefSharp/issues/3114#issuecomment-717334316

Issue #3114
2020-10-28 13:42:01 +10:00
amaitland 57ab2ec982 WPF - Add CompositionTargetRenderHandler (experimental) 2019-12-13 21:07:25 +10:00
amaitland b1bd7499e5 WPF - Interop/WritableBitmapRenderHandler memory allocation improvement
If the MemoryMappedFile is smaller than we need then create a larger one
2019-09-07 12:15:49 +10:00
amaitland b1b930605c WPF - Replace RtlCopyMemory p/invoke with NativeMethodWrapper.MemoryCopy
- RtlCopyMemory only works on x64, we could use the slower RtlMoveMemory, going with a native wrapper around RtlCopyMemory
- Renamed CopyMemoryUsingHandle to MemoryCopy (cannot be CopyMemory or RtlCopyMemory as macro with that name already exists)

https://github.com/cefsharp/CefSharp/pull/2885#issuecomment-529033351

Issue #2885
2019-09-07 09:02:30 +10:00
Konstantin Preißer c311a581e6 WPF - Modify CopyMemory EntryPoint to work with .Net Core (#2885)
* Fix the entrypoint declaration for CopyMemory.

Contributes to #2796

* Follow-Up: Switch to RtlCopyMemory which is faster, but requires that the buffers do not overlap.
2019-09-06 13:15:47 +10:00
amaitland 4a145bf363 WPF ByteArrayWritableBitmapRenderHandler - Remove base class
AbstractRenderHandler - change pixel properties to internal so they can be shared ByteArrayWritableBitmapRenderHandler
WritableBitmapRenderHandler - run Format Document (changed fields to read only)

Follow up to #2652
2019-03-01 13:19:35 +10:00
Chris 5c292cd707 WPF - Refactor RenderHandler implementations (#2652)
* WPF - Refactored the RenderHandler implementations

* Added a AbstractRenderHandler
* Refactored the RenderHandlers to inherit from AbstractRenderHandler
* Implemented the correct and thread safe dispose pattern

* WPF - AbstractRenderHandler updated xml documentation

* WPF - ByteArrayWritableBitmapRenderHandler: Removed incorrect PixelFormat

* WPF - AbstractRenderHandler: Added missing GC.SuppressFinalize
2019-03-01 13:03:52 +10:00
amaitland bbf7795d80 WPF/OffScreen - Add OnAcceleratedPaint
Exposes the CEF API for Shared D3D11 Texture support. This should be considered experimental as there are quite a few known bugs in the CEF implementation
(PDF Viewer not working correctly)

OffScreen.ChromiumWebBrowser.CreateBrowser API changed (breaking change) now pass in `WindowInfo` to customise settings
Refactor CreateBrowser to support windowed and OSR rendering (now accepts IWindowInfo)

Resolves #2527
2018-12-16 19:37:12 +10:00
maloshuk 5622809d68 WPF - Change PixelFormat from Bgra32 to Pbgra32 to fix control transparency (#2589)
* WPF - set PixelFormats.Pbgra32 for all rendering methods #2127
2018-12-07 19:42:54 +10:00
Chris bef5dd37c4 Maintenance - Fixed formatting, file encoding, and copyright year (#2504)
* Applied formatting

* Fixed file encoding + Updated copyright year

* Updated License

* Fixed more file encoding

* Copyright notice now shows the year the file was created
2018-09-10 10:41:13 +10:00
amaitland 28f43261b6 Xml Doc - Add more comments and fixes 2018-09-05 13:02:43 +10:00
amaitland 93fdd63525 WPF - Fix incorrect param ordering of IRenderHandler.OnPaint
Param order now matches CEF interface
2018-04-23 13:06:05 +10:00
amaitland c1b89c62e9 WPF/OffScreen - Code cleanup and minor refactor
IRenderWebBrowser - Method naming now matches CEF, xmldoc updated to be more accurate

CefSharp.Wpf.ChromiumWebBrowser and CefSharp.OffScreen.ChromiumWebBrowser both updated as a result of IRenderWebBrowser changes
Should be minimal public API changes, should only require changes for those that are implementing their own rendering, who will have a major rewrite on their hands regardless of this.
2018-04-20 14:49:25 +10:00
amaitland b97c0c54b5 WPF - Add ByteArrayWritableBitmapRenderHandler
Copies every bitmap into a unique byte[], no locking is used.
Will use lots of memory
2018-04-05 16:53:55 +10:00
amaitland 895ad8d94f WPF OSR - Rename IBitmapFactory to IRenderHandler
At some point it would be nice to expose the whole of the CefRenderHandler API, this should at some point make that easier.

Issue #2237
2018-03-21 14:36:30 +10:00
amaitland 73894a592d WPF OSR Rendering - InteropBitmapFactory split the experimental resize on increase option into IncreaseBufferInteropBitmapFactory
Also some minor threading improvements and buffer validation (check if closed and invalid)
2018-03-18 00:07:37 +10:00