Bug 606279, part 3: Port transformed rendering to PDocumentRenderer. r=joe

This commit is contained in:
Chris Jones 2010-10-26 17:20:53 -05:00
Родитель 6170cbcb5c
Коммит d9065bdd3b
8 изменённых файлов: 23 добавлений и 10 удалений

Просмотреть файл

@ -54,7 +54,8 @@ public:
virtual ~DocumentRendererChild();
bool RenderDocument(nsIDOMWindow *window,
const nsRect& documentRect, const nsString& bgcolor,
const nsRect& documentRect, const gfxMatrix& transform,
const nsString& bgcolor,
PRUint32 renderFlags, PRBool flushLayout,
nsIntSize* renderedSize, nsCString& data);

Просмотреть файл

@ -101,6 +101,7 @@ FlushLayoutForTree(nsIDOMWindow* aWindow)
bool
DocumentRendererChild::RenderDocument(nsIDOMWindow *window,
const nsRect& documentRect,
const gfxMatrix& transform,
const nsString& bgcolor,
PRUint32 renderFlags,
PRBool flushLayout,
@ -140,6 +141,7 @@ DocumentRendererChild::RenderDocument(nsIDOMWindow *window,
4 * w,
gfxASurface::ImageFormatARGB32);
nsRefPtr<gfxContext> ctx = new gfxContext(surf);
ctx->SetMatrix(transform);
presShell->RenderDocument(documentRect, renderFlags, bgColor, ctx);
*renderedSize = nsIntSize(w, h);

Просмотреть файл

@ -3746,6 +3746,7 @@ nsCanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* aElem, float a
if (mIPC) {
PDocumentRendererParent *pdocrender =
child->SendPDocumentRendererConstructor(rect,
mThebes->CurrentMatrix(),
nsString(aBGColor),
renderDocFlags, flush);
if (!pdocrender)

Просмотреть файл

@ -275,13 +275,15 @@ child:
* request finishes, PDocumentRenderer:__delete__ is sent back to
* this side to notify completion.
*
* |documentRect| is the area of the remote document to draw. The
* rendered area will have the default background color |bgcolor|.
* |renderFlags| are the nsIPresShell::RenderDocument() flags to
* use on the remote side, and if true, |flushLayout| will do just
* that before rendering the document.
* |documentRect| is the area of the remote document to draw,
* transformed by |transform|. The rendered area will have the
* default background color |bgcolor|. |renderFlags| are the
* nsIPresShell::RenderDocument() flags to use on the remote side,
* and if true, |flushLayout| will do just that before rendering
* the document.
*/
PDocumentRenderer(nsRect documentRect, nsString bgcolor,
PDocumentRenderer(nsRect documentRect, gfxMatrix transform,
nsString bgcolor,
PRUint32 renderFlags, bool flushLayout);
/**

Просмотреть файл

@ -594,6 +594,7 @@ TabChild::DispatchWidgetEvent(nsGUIEvent& event)
PDocumentRendererChild*
TabChild::AllocPDocumentRenderer(const nsRect& documentRect,
const gfxMatrix& transform,
const nsString& bgcolor,
const PRUint32& renderFlags,
const bool& flushLayout)
@ -611,6 +612,7 @@ TabChild::DeallocPDocumentRenderer(PDocumentRendererChild* actor)
bool
TabChild::RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
const nsRect& documentRect,
const gfxMatrix& transform,
const nsString& bgcolor,
const PRUint32& renderFlags,
const bool& flushLayout)
@ -630,7 +632,8 @@ TabChild::RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
nsIntSize renderedSize;
nsCString data;
bool ret = render->RenderDocument(window,
documentRect, bgcolor,
documentRect, transform,
bgcolor,
renderFlags, flushLayout,
&renderedSize, data);
if (!ret)

Просмотреть файл

@ -199,11 +199,13 @@ public:
const nsString& aJSON);
virtual PDocumentRendererChild*
AllocPDocumentRenderer(const nsRect& documentRect, const nsString& bgcolor,
AllocPDocumentRenderer(const nsRect& documentRect, const gfxMatrix& transform,
const nsString& bgcolor,
const PRUint32& renderFlags, const bool& flushLayout);
virtual bool DeallocPDocumentRenderer(PDocumentRendererChild* actor);
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
const nsRect& documentRect,
const gfxMatrix& transform,
const nsString& bgcolor,
const PRUint32& renderFlags,
const bool& flushLayout);

Просмотреть файл

@ -220,6 +220,7 @@ TabParent::GetSSLStatus(nsISupports ** aStatus)
PDocumentRendererParent*
TabParent::AllocPDocumentRenderer(const nsRect& documentRect,
const gfxMatrix& transform,
const nsString& bgcolor,
const PRUint32& renderFlags,
const bool& flushLayout)

Просмотреть файл

@ -133,7 +133,8 @@ public:
PRBool aPreventDefault);
virtual PDocumentRendererParent*
AllocPDocumentRenderer(const nsRect& documentRect, const nsString& bgcolor,
AllocPDocumentRenderer(const nsRect& documentRect, const gfxMatrix& transform,
const nsString& bgcolor,
const PRUint32& renderFlags, const bool& flushLayout);
virtual bool DeallocPDocumentRenderer(PDocumentRendererParent* actor);