зеркало из https://github.com/mozilla/pjs.git
bug 459796. Add optional flags to drawWindow to allow finer control. r=vlad
This commit is contained in:
Родитель
ae0b7de20c
Коммит
8cb113a4b8
|
@ -3347,7 +3347,8 @@ FlushLayoutForTree(nsIDOMWindow* aWindow)
|
|||
NS_IMETHODIMP
|
||||
nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, PRInt32 aX, PRInt32 aY,
|
||||
PRInt32 aW, PRInt32 aH,
|
||||
const nsAString& aBGColor)
|
||||
const nsAString& aBGColor,
|
||||
PRUint32 flags)
|
||||
{
|
||||
NS_ENSURE_ARG(aWindow != nsnull);
|
||||
|
||||
|
@ -3369,6 +3370,7 @@ nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, PRInt32 aX, PRInt3
|
|||
}
|
||||
|
||||
// Flush layout updates
|
||||
if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH)
|
||||
FlushLayoutForTree(aWindow);
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
|
|
|
@ -60,7 +60,7 @@ interface nsIDOMTextMetrics : nsISupports
|
|||
readonly attribute float width;
|
||||
};
|
||||
|
||||
[scriptable, uuid(ac35c6a9-bea7-4e5f-85f6-ed43a13c6a2b)]
|
||||
[scriptable, uuid(66e6d87c-759c-43a7-b3d3-3348180b35df)]
|
||||
interface nsIDOMCanvasRenderingContext2D : nsISupports
|
||||
{
|
||||
// back-reference to the canvas element for which
|
||||
|
@ -161,6 +161,12 @@ interface nsIDOMCanvasRenderingContext2D : nsISupports
|
|||
// ImageData createImageData(in float w, in float h);
|
||||
void createImageData();
|
||||
|
||||
// Show the caret if appropriate when drawing
|
||||
const unsigned long DRAWWINDOW_DRAW_CARET = 0x01;
|
||||
// Don't flush pending layout notifications that could otherwise
|
||||
// be batched up
|
||||
const unsigned long DRAWWINDOW_DO_NOT_FLUSH = 0x02;
|
||||
|
||||
/**
|
||||
* Renders a region of a window into the canvas. The contents of
|
||||
* the window's viewport are rendered, ignoring viewport clipping
|
||||
|
@ -177,6 +183,9 @@ interface nsIDOMCanvasRenderingContext2D : nsISupports
|
|||
* transparent/translucent. It is given as a CSS color string
|
||||
* (e.g., rgb() or rgba()).
|
||||
*
|
||||
* @param flags Uused to better control the drawWindow call.
|
||||
* Flags can be ORed together.
|
||||
*
|
||||
* Of course, the rendering obeys the current scale, transform and
|
||||
* globalAlpha values.
|
||||
*
|
||||
|
@ -194,5 +203,6 @@ interface nsIDOMCanvasRenderingContext2D : nsISupports
|
|||
* only.
|
||||
*/
|
||||
void drawWindow(in nsIDOMWindow window, in long x, in long y,
|
||||
in long w, in long h, in DOMString bgColor);
|
||||
in long w, in long h, in DOMString bgColor,
|
||||
[optional] in unsigned long flags);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче