Bug 47207. Changing printf to PRINTF to use new logging facility. r=valeski,sr=waterson
git-svn-id: svn://10.0.0.236/trunk@81885 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -33,6 +33,11 @@
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsICompositeListener.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsViewManager2Log)
|
||||
#define PRINTF NS_LOG_PRINTF(nsViewManager2Log)
|
||||
#define FLUSH NS_LOG_FLUSH(nsViewManager2Log)
|
||||
|
||||
static NS_DEFINE_IID(kBlenderCID, NS_BLENDER_CID);
|
||||
static NS_DEFINE_IID(kRegionCID, NS_REGION_CID);
|
||||
@@ -81,7 +86,7 @@ static void vm_timer_callback(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
nsViewManager2 *vm = (nsViewManager2 *)aClosure;
|
||||
|
||||
printf("ViewManager2 timer callback\n");
|
||||
PRINTF("ViewManager2 timer callback\n");
|
||||
|
||||
//restart the timer
|
||||
|
||||
@@ -92,7 +97,7 @@ static void vm_timer_callback(nsITimer *aTimer, void *aClosure)
|
||||
vm->mFrameRate = 0;
|
||||
vm->SetFrameRate(fr);
|
||||
}
|
||||
//printf("timer composite...\n");
|
||||
//PRINTF("timer composite...\n");
|
||||
#ifndef XP_MAC
|
||||
//XXX temporary: The Mac doesn't need the timer to repaint but
|
||||
// obviously this is not the good method to disable the thing.
|
||||
@@ -442,11 +447,11 @@ NS_IMETHODIMP nsViewManager2::SetWindowDimensions(nscoord width, nscoord height)
|
||||
if (nsnull != mRootView)
|
||||
mRootView->SetDimensions(width, height);
|
||||
|
||||
//printf("new dims: %d %d\n", width, height);
|
||||
//PRINTF("new dims: %d %d\n", width, height);
|
||||
// Inform the presentation shell that we've been resized
|
||||
if (nsnull != mObserver)
|
||||
mObserver->ResizeReflow(mRootView, width, height);
|
||||
//printf("reflow done\n");
|
||||
//PRINTF("reflow done\n");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -480,7 +485,7 @@ void nsViewManager2::Refresh(nsIView *aView, nsIRenderingContext *aContext, nsIR
|
||||
|
||||
mPainting = PR_TRUE;
|
||||
|
||||
//printf("refreshing region...\n");
|
||||
//PRINTF("refreshing region...\n");
|
||||
//force double buffering because of non-opaque views?
|
||||
|
||||
if (mTransCnt > 0)
|
||||
@@ -606,9 +611,9 @@ void nsViewManager2::Refresh(nsIView *aView, nsIRenderingContext *aContext, cons
|
||||
|
||||
//force double buffering because of non-opaque views?
|
||||
|
||||
//printf("refreshing rect... ");
|
||||
//PRINTF("refreshing rect... ");
|
||||
//stdout << *rect;
|
||||
//printf("\n");
|
||||
//PRINTF("\n");
|
||||
if (mTransCnt > 0)
|
||||
aUpdateFlags |= NS_VMREFRESH_DOUBLE_BUFFER;
|
||||
|
||||
@@ -1076,7 +1081,7 @@ void nsViewManager2::InvalidateChildWidgets(nsIView *aView, nsRect& aDirtyRect)
|
||||
mContext->GetAppUnitsToDevUnits(scale);
|
||||
invalidRect.ScaleRoundOut(scale);
|
||||
|
||||
//printf("invalidating: view %x (pix) %d, %d\n", aView, pixrect.width, pixrect.height);
|
||||
//PRINTF("invalidating: view %x (pix) %d, %d\n", aView, pixrect.width, pixrect.height);
|
||||
widget->Invalidate(invalidRect, PR_FALSE);
|
||||
}
|
||||
}
|
||||
@@ -1292,7 +1297,7 @@ NS_IMETHODIMP nsViewManager2::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *a
|
||||
float p2t;
|
||||
mContext->GetDevUnitsToAppUnits(p2t);
|
||||
|
||||
//printf("resize: (pix) %d, %d\n", width, height);
|
||||
//PRINTF("resize: (pix) %d, %d\n", width, height);
|
||||
SetWindowDimensions(NSIntPixelsToTwips(width, p2t),
|
||||
NSIntPixelsToTwips(height, p2t));
|
||||
*aStatus = nsEventStatus_eConsumeNoDefault;
|
||||
@@ -1343,7 +1348,7 @@ NS_IMETHODIMP nsViewManager2::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *a
|
||||
// XXX rods
|
||||
updateFlags |= NS_VMREFRESH_DOUBLE_BUFFER;
|
||||
|
||||
//printf("refreshing: view: %x, %d, %d, %d, %d\n", view, damrect.x, damrect.y, damrect.width, damrect.height);
|
||||
//PRINTF("refreshing: view: %x, %d, %d, %d, %d\n", view, damrect.x, damrect.y, damrect.width, damrect.height);
|
||||
// Refresh the view
|
||||
Refresh(view, ((nsPaintEvent*)aEvent)->renderingContext, &damrect, updateFlags);
|
||||
}
|
||||
@@ -1472,9 +1477,9 @@ NS_IMETHODIMP nsViewManager2::GrabMouseEvents(nsIView *aView, PRBool &aResult)
|
||||
#ifdef DEBUG_mjudge
|
||||
if (aView)
|
||||
{
|
||||
printf("capturing mouse events for view %x\n",aView);
|
||||
PRINTF("capturing mouse events for view %x\n",aView);
|
||||
}
|
||||
printf("removing mouse capture from view %x\n",mMouseGrabber);
|
||||
PRINTF("removing mouse capture from view %x\n",mMouseGrabber);
|
||||
#endif
|
||||
|
||||
mMouseGrabber = aView;
|
||||
@@ -1931,7 +1936,7 @@ void nsViewManager2::GetMaxWidgetBounds(nsRect& aMaxWidgetBounds) const
|
||||
}
|
||||
}
|
||||
|
||||
// printf("WIDGET BOUNDS %d %d\n", aMaxWidgetBounds.width, aMaxWidgetBounds.height);
|
||||
// PRINTF("WIDGET BOUNDS %d %d\n", aMaxWidgetBounds.width, aMaxWidgetBounds.height);
|
||||
}
|
||||
|
||||
PRBool nsViewManager2::RectFitsInside(nsRect& aRect, PRInt32 aWidth, PRInt32 aHeight) const
|
||||
@@ -2018,7 +2023,7 @@ void nsViewManager2::CalculateDiscreteSurfaceSize(nsRect& aRequestedSize, nsRect
|
||||
gLargestRequestedSize.height = PR_MAX(aRequestedSize.height, aMaxWidgetSize.height);
|
||||
aSurfaceSize.width = gLargestRequestedSize.width;
|
||||
aSurfaceSize.height = gLargestRequestedSize.height;
|
||||
// printf("Expanding the largested requested size to %d %d\n", gLargestRequestedSize.width, gLargestRequestedSize.height);
|
||||
// PRINTF("Expanding the largested requested size to %d %d\n", gLargestRequestedSize.width, gLargestRequestedSize.height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2045,7 +2050,7 @@ nsDrawingSurface nsViewManager2::GetDrawingSurface(nsIRenderingContext &aContext
|
||||
}
|
||||
|
||||
nsresult rv = aContext.CreateDrawingSurface(&newBounds, 0, mDrawingSurface);
|
||||
// printf("Allocating a new drawing surface %d %d\n", newBounds.width, newBounds.height);
|
||||
// PRINTF("Allocating a new drawing surface %d %d\n", newBounds.width, newBounds.height);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mDSBounds = newBounds;
|
||||
aContext.SelectOffScreenDrawingSurface(mDrawingSurface);
|
||||
@@ -2626,7 +2631,7 @@ void nsViewManager2::ShowDisplayList(PRInt32 flatlen)
|
||||
float t2p;
|
||||
mContext->GetAppUnitsToDevUnits(t2p);
|
||||
|
||||
printf("### display list length=%d ###\n", flatlen);
|
||||
PRINTF("### display list length=%d ###\n", flatlen);
|
||||
|
||||
for (cnt = 0; cnt < flatlen; cnt++) {
|
||||
nsIView *view, *parent;
|
||||
@@ -2644,7 +2649,7 @@ void nsViewManager2::ShowDisplayList(PRInt32 flatlen)
|
||||
view->GetParent(parent);
|
||||
view->GetZIndex(zindex);
|
||||
rect *= t2p;
|
||||
printf("%snsIView@%p [z=%d, x=%d, y=%d, w=%d, h=%d, p=%p]\n",
|
||||
PRINTF("%snsIView@%p [z=%d, x=%d, y=%d, w=%d, h=%d, p=%p]\n",
|
||||
nest, view, zindex,
|
||||
rect.x, rect.y, rect.width, rect.height, parent);
|
||||
|
||||
@@ -2652,22 +2657,22 @@ void nsViewManager2::ShowDisplayList(PRInt32 flatlen)
|
||||
|
||||
if (flags)
|
||||
{
|
||||
printf("%s", nest);
|
||||
PRINTF("%s", nest);
|
||||
|
||||
if (flags & POP_CLIP) {
|
||||
printf("POP_CLIP ");
|
||||
PRINTF("POP_CLIP ");
|
||||
newnestcnt--;
|
||||
}
|
||||
|
||||
if (flags & PUSH_CLIP) {
|
||||
printf("PUSH_CLIP ");
|
||||
PRINTF("PUSH_CLIP ");
|
||||
newnestcnt++;
|
||||
}
|
||||
|
||||
if (flags & VIEW_RENDERED)
|
||||
printf("VIEW_RENDERED ");
|
||||
PRINTF("VIEW_RENDERED ");
|
||||
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
}
|
||||
|
||||
nest[nestcnt << 1] = ' ';
|
||||
@@ -2844,14 +2849,14 @@ PRBool nsViewManager2::IsRectVisible(nsIView *aView, const nsRect &aRect)
|
||||
// Debugging code
|
||||
static int toggle = 0;
|
||||
for (int i = 0; i < toggle; i++) {
|
||||
printf(" ");
|
||||
PRINTF(" ");
|
||||
}
|
||||
if (toggle == 10) {
|
||||
toggle = 0;
|
||||
} else {
|
||||
toggle++;
|
||||
}
|
||||
printf("***overlaps %d\n", overlaps);
|
||||
PRINTF("***overlaps %d\n", overlaps);
|
||||
#endif
|
||||
|
||||
return overlaps;
|
||||
@@ -2909,7 +2914,7 @@ nsViewManager2::IsPainting(PRBool& aIsPainting)
|
||||
nsresult
|
||||
nsViewManager2::ProcessWidgetChanges(nsIView* aView)
|
||||
{
|
||||
//printf("---------Begin Sync----------\n");
|
||||
//PRINTF("---------Begin Sync----------\n");
|
||||
nsresult rv = aView->SynchWidgetSizePosition();
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
@@ -2924,7 +2929,7 @@ nsViewManager2::ProcessWidgetChanges(nsIView* aView)
|
||||
child->GetNextSibling(child);
|
||||
}
|
||||
|
||||
//printf("---------End Sync----------\n");
|
||||
//PRINTF("---------End Sync----------\n");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user