From bfec2c95b11a053b5ea79de63b6ba141e65ebf8f Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 29 Jan 2015 15:25:08 +1000 Subject: [PATCH] Add IBitmapFactory so that different Rendering methods can be plugged in (potentially a .Net 4.5 InteropBitmapInfo can be created) Move into Rendering namespace --- CefSharp.Core/Internals/RenderClientAdapter.h | 11 ++++----- CefSharp.Wpf/CefSharp.Wpf.csproj | 8 ++++--- CefSharp.Wpf/ChromiumWebBrowser.cs | 9 ++++++-- CefSharp.Wpf/Rendering/BitmapFactory.cs | 17 ++++++++++++++ .../{ => Rendering}/InteropBitmapInfo.cs | 2 +- CefSharp.Wpf/{ => Rendering}/WpfBitmapInfo.cs | 2 +- .../{ => Rendering}/WritableBitmapInfo.cs | 23 ++++++------------- CefSharp.Wpf/RenderingEventArgs.cs | 2 +- CefSharp/CefSharp.csproj | 1 + CefSharp/IBitmapFactory.cs | 13 +++++++++++ CefSharp/Internals/BitmapInfo.cs | 2 +- 11 files changed, 58 insertions(+), 32 deletions(-) create mode 100644 CefSharp.Wpf/Rendering/BitmapFactory.cs rename CefSharp.Wpf/{ => Rendering}/InteropBitmapInfo.cs (96%) rename CefSharp.Wpf/{ => Rendering}/WpfBitmapInfo.cs (92%) rename CefSharp.Wpf/{ => Rendering}/WritableBitmapInfo.cs (61%) create mode 100644 CefSharp/IBitmapFactory.cs diff --git a/CefSharp.Core/Internals/RenderClientAdapter.h b/CefSharp.Core/Internals/RenderClientAdapter.h index f6eac8794..a031b8b97 100644 --- a/CefSharp.Core/Internals/RenderClientAdapter.h +++ b/CefSharp.Core/Internals/RenderClientAdapter.h @@ -94,14 +94,11 @@ namespace CefSharp if(bitmapInfo->DirtyRectSupport) { - auto rects = gcnew List(dirtyRects.size()); + //NOTE: According to https://bitbucket.org/chromiumembedded/branches-2171-cef3/commits/ce984ddff3268a50cf9967487327e1257015b98c + // There is only one rect now that's a union of all dirty regions. API Still passes in a vector - for each(CefRect r in dirtyRects) - { - rects->Add(CefDirtyRect(r.x, r.y, r.width, r.height)); - } - - bitmapInfo->DirtyRects = rects; + CefRect r = dirtyRects.front(); + bitmapInfo->DirtyRect = CefDirtyRect(r.x, r.y, r.width, r.height); } auto backBufferHandle = (HANDLE)bitmapInfo->BackBufferHandle; diff --git a/CefSharp.Wpf/CefSharp.Wpf.csproj b/CefSharp.Wpf/CefSharp.Wpf.csproj index 79cab498c..ebc386349 100644 --- a/CefSharp.Wpf/CefSharp.Wpf.csproj +++ b/CefSharp.Wpf/CefSharp.Wpf.csproj @@ -93,7 +93,7 @@ - + Code @@ -101,9 +101,10 @@ + - - + + @@ -115,6 +116,7 @@ CefSharp +