From 5b69e05939c7fd3f917e2dd0f399774b3b15c886 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 2 Mar 2018 15:56:02 -0500 Subject: Bug 1438425 - Delete DocumentRenderer. r=jesup, a=RyanVM It is unused. --HG-- extra : histedit_source : b7af9f250f0330f90547114184873ae9971f20fc --- dom/canvas/DocumentRendererParent.cpp | 63 ----------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 dom/canvas/DocumentRendererParent.cpp (limited to 'dom/canvas/DocumentRendererParent.cpp') diff --git a/dom/canvas/DocumentRendererParent.cpp b/dom/canvas/DocumentRendererParent.cpp deleted file mode 100644 index d9578ac4e..000000000 --- a/dom/canvas/DocumentRendererParent.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "mozilla/ipc/DocumentRendererParent.h" - -#include "gfx2DGlue.h" -#include "mozilla/gfx/2D.h" -#include "mozilla/gfx/PathHelpers.h" -#include "mozilla/RefPtr.h" -#include "nsICanvasRenderingContextInternal.h" - -using namespace mozilla; -using namespace mozilla::gfx; -using namespace mozilla::ipc; - -DocumentRendererParent::DocumentRendererParent() -{} - -DocumentRendererParent::~DocumentRendererParent() -{} - -void DocumentRendererParent::SetCanvasContext(nsICanvasRenderingContextInternal* aCanvas, - gfxContext* ctx) -{ - mCanvas = aCanvas; - mCanvasContext = ctx; -} - -void DocumentRendererParent::DrawToCanvas(const nsIntSize& aSize, - const nsCString& aData) -{ - if (!mCanvas || !mCanvasContext) - return; - - DrawTarget* drawTarget = mCanvasContext->GetDrawTarget(); - Rect rect(0, 0, aSize.width, aSize.height); - MaybeSnapToDevicePixels(rect, *drawTarget, true); - RefPtr dataSurface = - Factory::CreateWrappingDataSourceSurface(reinterpret_cast(const_cast(aData).BeginWriting()), - aSize.width * 4, - IntSize(aSize.width, aSize.height), - SurfaceFormat::B8G8R8A8); - SurfacePattern pattern(dataSurface, ExtendMode::CLAMP); - drawTarget->FillRect(rect, pattern); - - gfxRect damageRect = mCanvasContext->UserToDevice(ThebesRect(rect)); - mCanvas->Redraw(damageRect); -} - -void -DocumentRendererParent::ActorDestroy(ActorDestroyReason aWhy) -{ - // Implement me! Bug 1005139 -} - -bool -DocumentRendererParent::Recv__delete__(const nsIntSize& renderedSize, - const nsCString& data) -{ - DrawToCanvas(renderedSize, data); - return true; -} -- cgit v1.2.3 From 302f17e514772770f5555ce939b21b194514ebc3 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Mar 2018 12:38:55 +0100 Subject: Revert "Bug 1438425 - Delete DocumentRenderer. r=jesup, a=RyanVM" This reverts commit 5b69e05939c7fd3f917e2dd0f399774b3b15c886. --- dom/canvas/DocumentRendererParent.cpp | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 dom/canvas/DocumentRendererParent.cpp (limited to 'dom/canvas/DocumentRendererParent.cpp') diff --git a/dom/canvas/DocumentRendererParent.cpp b/dom/canvas/DocumentRendererParent.cpp new file mode 100644 index 000000000..d9578ac4e --- /dev/null +++ b/dom/canvas/DocumentRendererParent.cpp @@ -0,0 +1,63 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/ipc/DocumentRendererParent.h" + +#include "gfx2DGlue.h" +#include "mozilla/gfx/2D.h" +#include "mozilla/gfx/PathHelpers.h" +#include "mozilla/RefPtr.h" +#include "nsICanvasRenderingContextInternal.h" + +using namespace mozilla; +using namespace mozilla::gfx; +using namespace mozilla::ipc; + +DocumentRendererParent::DocumentRendererParent() +{} + +DocumentRendererParent::~DocumentRendererParent() +{} + +void DocumentRendererParent::SetCanvasContext(nsICanvasRenderingContextInternal* aCanvas, + gfxContext* ctx) +{ + mCanvas = aCanvas; + mCanvasContext = ctx; +} + +void DocumentRendererParent::DrawToCanvas(const nsIntSize& aSize, + const nsCString& aData) +{ + if (!mCanvas || !mCanvasContext) + return; + + DrawTarget* drawTarget = mCanvasContext->GetDrawTarget(); + Rect rect(0, 0, aSize.width, aSize.height); + MaybeSnapToDevicePixels(rect, *drawTarget, true); + RefPtr dataSurface = + Factory::CreateWrappingDataSourceSurface(reinterpret_cast(const_cast(aData).BeginWriting()), + aSize.width * 4, + IntSize(aSize.width, aSize.height), + SurfaceFormat::B8G8R8A8); + SurfacePattern pattern(dataSurface, ExtendMode::CLAMP); + drawTarget->FillRect(rect, pattern); + + gfxRect damageRect = mCanvasContext->UserToDevice(ThebesRect(rect)); + mCanvas->Redraw(damageRect); +} + +void +DocumentRendererParent::ActorDestroy(ActorDestroyReason aWhy) +{ + // Implement me! Bug 1005139 +} + +bool +DocumentRendererParent::Recv__delete__(const nsIntSize& renderedSize, + const nsCString& data) +{ + DrawToCanvas(renderedSize, data); + return true; +} -- cgit v1.2.3 From 07148526de8085dc4e36169560805d541d272624 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Wed, 7 Mar 2018 11:54:01 -0500 Subject: Bug 1438425 - Delete DocumentRenderer. r=jesup, r=jgilbert, a=RyanVM It is unused. --- dom/canvas/DocumentRendererParent.cpp | 63 ----------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 dom/canvas/DocumentRendererParent.cpp (limited to 'dom/canvas/DocumentRendererParent.cpp') diff --git a/dom/canvas/DocumentRendererParent.cpp b/dom/canvas/DocumentRendererParent.cpp deleted file mode 100644 index d9578ac4e..000000000 --- a/dom/canvas/DocumentRendererParent.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "mozilla/ipc/DocumentRendererParent.h" - -#include "gfx2DGlue.h" -#include "mozilla/gfx/2D.h" -#include "mozilla/gfx/PathHelpers.h" -#include "mozilla/RefPtr.h" -#include "nsICanvasRenderingContextInternal.h" - -using namespace mozilla; -using namespace mozilla::gfx; -using namespace mozilla::ipc; - -DocumentRendererParent::DocumentRendererParent() -{} - -DocumentRendererParent::~DocumentRendererParent() -{} - -void DocumentRendererParent::SetCanvasContext(nsICanvasRenderingContextInternal* aCanvas, - gfxContext* ctx) -{ - mCanvas = aCanvas; - mCanvasContext = ctx; -} - -void DocumentRendererParent::DrawToCanvas(const nsIntSize& aSize, - const nsCString& aData) -{ - if (!mCanvas || !mCanvasContext) - return; - - DrawTarget* drawTarget = mCanvasContext->GetDrawTarget(); - Rect rect(0, 0, aSize.width, aSize.height); - MaybeSnapToDevicePixels(rect, *drawTarget, true); - RefPtr dataSurface = - Factory::CreateWrappingDataSourceSurface(reinterpret_cast(const_cast(aData).BeginWriting()), - aSize.width * 4, - IntSize(aSize.width, aSize.height), - SurfaceFormat::B8G8R8A8); - SurfacePattern pattern(dataSurface, ExtendMode::CLAMP); - drawTarget->FillRect(rect, pattern); - - gfxRect damageRect = mCanvasContext->UserToDevice(ThebesRect(rect)); - mCanvas->Redraw(damageRect); -} - -void -DocumentRendererParent::ActorDestroy(ActorDestroyReason aWhy) -{ - // Implement me! Bug 1005139 -} - -bool -DocumentRendererParent::Recv__delete__(const nsIntSize& renderedSize, - const nsCString& data) -{ - DrawToCanvas(renderedSize, data); - return true; -} -- cgit v1.2.3