зеркало из https://github.com/mozilla/gecko-dev.git
Bug 952977: Use gfx::Matrix in ipdl r=nical
This commit is contained in:
Родитель
3831dd14f5
Коммит
de37e93bb2
|
@ -19,11 +19,11 @@ class DocumentRendererChild : public PDocumentRendererChild
|
|||
public:
|
||||
DocumentRendererChild();
|
||||
virtual ~DocumentRendererChild();
|
||||
|
||||
|
||||
bool RenderDocument(nsIDOMWindow *window,
|
||||
const nsRect& documentRect, const gfxMatrix& transform,
|
||||
const nsRect& documentRect, const gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
uint32_t renderFlags, bool flushLayout,
|
||||
uint32_t renderFlags, bool flushLayout,
|
||||
const nsIntSize& renderSize, nsCString& data);
|
||||
|
||||
private:
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "gfx2DGlue.h"
|
||||
#include "gfxImageSurface.h"
|
||||
#include "gfxPattern.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
@ -22,7 +23,9 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsCSSValue.h"
|
||||
#include "nsRuleNode.h"
|
||||
#include "mozilla/gfx/Matrix.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::ipc;
|
||||
|
||||
DocumentRendererChild::DocumentRendererChild()
|
||||
|
@ -34,10 +37,10 @@ DocumentRendererChild::~DocumentRendererChild()
|
|||
bool
|
||||
DocumentRendererChild::RenderDocument(nsIDOMWindow *window,
|
||||
const nsRect& documentRect,
|
||||
const gfxMatrix& transform,
|
||||
const mozilla::gfx::Matrix& transform,
|
||||
const nsString& aBGColor,
|
||||
uint32_t renderFlags,
|
||||
bool flushLayout,
|
||||
bool flushLayout,
|
||||
const nsIntSize& renderSize,
|
||||
nsCString& data)
|
||||
{
|
||||
|
@ -75,7 +78,7 @@ DocumentRendererChild::RenderDocument(nsIDOMWindow *window,
|
|||
4 * renderSize.width,
|
||||
gfxImageFormatARGB32);
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(surf);
|
||||
ctx->SetMatrix(transform);
|
||||
ctx->SetMatrix(mozilla::gfx::ThebesMatrix(transform));
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = presContext->PresShell();
|
||||
shell->RenderDocument(documentRect, renderFlags, bgColor, ctx);
|
||||
|
|
|
@ -19,7 +19,7 @@ include URIParams;
|
|||
|
||||
|
||||
using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
|
||||
using struct gfxMatrix from "gfxMatrix.h";
|
||||
using struct mozilla::gfx::Matrix from "mozilla/gfx/Matrix.h";
|
||||
using struct gfxSize from "gfxPoint.h";
|
||||
using CSSRect from "Units.h";
|
||||
using struct mozilla::layers::FrameMetrics from "FrameMetrics.h";
|
||||
|
@ -423,7 +423,7 @@ child:
|
|||
* and if true, |flushLayout| will do just that before rendering
|
||||
* the document. The rendered image will be of size |renderSize|.
|
||||
*/
|
||||
PDocumentRenderer(nsRect documentRect, gfxMatrix transform,
|
||||
PDocumentRenderer(nsRect documentRect, Matrix transform,
|
||||
nsString bgcolor,
|
||||
uint32_t renderFlags, bool flushLayout,
|
||||
nsIntSize renderSize);
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
#include "APZCCallbackHelper.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "ipc/nsGUIEventIPC.h"
|
||||
#include "mozilla/gfx/Matrix.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "PCOMContentPermissionRequestChild.h"
|
||||
|
@ -1981,7 +1982,7 @@ TabChild::DispatchWidgetEvent(WidgetGUIEvent& event)
|
|||
|
||||
PDocumentRendererChild*
|
||||
TabChild::AllocPDocumentRendererChild(const nsRect& documentRect,
|
||||
const gfxMatrix& transform,
|
||||
const mozilla::gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags,
|
||||
const bool& flushLayout,
|
||||
|
@ -2000,7 +2001,7 @@ TabChild::DeallocPDocumentRendererChild(PDocumentRendererChild* actor)
|
|||
bool
|
||||
TabChild::RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
|
||||
const nsRect& documentRect,
|
||||
const gfxMatrix& transform,
|
||||
const mozilla::gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags,
|
||||
const bool& flushLayout,
|
||||
|
|
|
@ -254,14 +254,14 @@ public:
|
|||
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
||||
|
||||
virtual PDocumentRendererChild*
|
||||
AllocPDocumentRendererChild(const nsRect& documentRect, const gfxMatrix& transform,
|
||||
AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags, const bool& flushLayout,
|
||||
const nsIntSize& renderSize);
|
||||
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor);
|
||||
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
|
||||
const nsRect& documentRect,
|
||||
const gfxMatrix& transform,
|
||||
const gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags,
|
||||
const bool& flushLayout,
|
||||
|
|
|
@ -579,7 +579,7 @@ TabParent::SetDocShell(nsIDocShell *aDocShell)
|
|||
|
||||
PDocumentRendererParent*
|
||||
TabParent::AllocPDocumentRendererParent(const nsRect& documentRect,
|
||||
const gfxMatrix& transform,
|
||||
const gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags,
|
||||
const bool& flushLayout,
|
||||
|
|
|
@ -221,7 +221,7 @@ public:
|
|||
bool SendHandleDoubleTap(const CSSIntPoint& aPoint);
|
||||
|
||||
virtual PDocumentRendererParent*
|
||||
AllocPDocumentRendererParent(const nsRect& documentRect, const gfxMatrix& transform,
|
||||
AllocPDocumentRendererParent(const nsRect& documentRect, const gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags, const bool& flushLayout,
|
||||
const nsIntSize& renderSize);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "gfx3DMatrix.h"
|
||||
#include "gfxColor.h"
|
||||
#include "gfxMatrix.h"
|
||||
#include "mozilla/gfx/Matrix.h"
|
||||
#include "GraphicsFilter.h"
|
||||
#include "gfxPoint.h"
|
||||
#include "gfxRect.h"
|
||||
|
@ -46,28 +46,28 @@ typedef GraphicsFilter::Enum GraphicsFilterType;
|
|||
namespace IPC {
|
||||
|
||||
template<>
|
||||
struct ParamTraits<gfxMatrix>
|
||||
struct ParamTraits<mozilla::gfx::Matrix>
|
||||
{
|
||||
typedef gfxMatrix paramType;
|
||||
typedef mozilla::gfx::Matrix paramType;
|
||||
|
||||
static void Write(Message* aMsg, const paramType& aParam)
|
||||
{
|
||||
WriteParam(aMsg, aParam.xx);
|
||||
WriteParam(aMsg, aParam.xy);
|
||||
WriteParam(aMsg, aParam.yx);
|
||||
WriteParam(aMsg, aParam.yy);
|
||||
WriteParam(aMsg, aParam.x0);
|
||||
WriteParam(aMsg, aParam.y0);
|
||||
WriteParam(aMsg, aParam._11);
|
||||
WriteParam(aMsg, aParam._12);
|
||||
WriteParam(aMsg, aParam._21);
|
||||
WriteParam(aMsg, aParam._22);
|
||||
WriteParam(aMsg, aParam._31);
|
||||
WriteParam(aMsg, aParam._32);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
if (ReadParam(aMsg, aIter, &aResult->xx) &&
|
||||
ReadParam(aMsg, aIter, &aResult->xy) &&
|
||||
ReadParam(aMsg, aIter, &aResult->yx) &&
|
||||
ReadParam(aMsg, aIter, &aResult->yy) &&
|
||||
ReadParam(aMsg, aIter, &aResult->x0) &&
|
||||
ReadParam(aMsg, aIter, &aResult->y0))
|
||||
if (ReadParam(aMsg, aIter, &aResult->_11) &&
|
||||
ReadParam(aMsg, aIter, &aResult->_12) &&
|
||||
ReadParam(aMsg, aIter, &aResult->_21) &&
|
||||
ReadParam(aMsg, aIter, &aResult->_22) &&
|
||||
ReadParam(aMsg, aIter, &aResult->_31) &&
|
||||
ReadParam(aMsg, aIter, &aResult->_32))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -75,8 +75,8 @@ struct ParamTraits<gfxMatrix>
|
|||
|
||||
static void Log(const paramType& aParam, std::wstring* aLog)
|
||||
{
|
||||
aLog->append(StringPrintf(L"[[%g %g] [%g %g] [%g %g]]", aParam.xx, aParam.xy, aParam.yx, aParam.yy,
|
||||
aParam.x0, aParam.y0));
|
||||
aLog->append(StringPrintf(L"[[%g %g] [%g %g] [%g %g]]", aParam._11, aParam._12, aParam._21, aParam._22,
|
||||
aParam._31, aParam._32));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче