diff --git a/view/public/nsIViewManager.h b/view/public/nsIViewManager.h index 50aa189dfc71..0e05e0c9c38d 100644 --- a/view/public/nsIViewManager.h +++ b/view/public/nsIViewManager.h @@ -36,7 +36,8 @@ typedef enum { nsContentQuality_kGood = 0, nsContentQuality_kFair, - nsContentQuality_kPoor + nsContentQuality_kPoor, + nsContentQuality_kUnknown } nsContentQuality; #define NS_IVIEWMANAGER_IID \ diff --git a/view/src/nsScrollingView.cpp b/view/src/nsScrollingView.cpp index e323ffed3c49..674a132b35d0 100644 --- a/view/src/nsScrollingView.cpp +++ b/view/src/nsScrollingView.cpp @@ -279,8 +279,10 @@ NS_IMETHODIMP CornerView :: Paint(nsIRenderingContext& rc, const nsRect& rect, rc.SetColor(NS_RGB(0, 255, 0)); else if (mQuality == nsContentQuality_kFair) rc.SetColor(NS_RGB(255, 176, 0)); - else + else if (mQuality == nsContentQuality_kPoor) rc.SetColor(NS_RGB(255, 0, 0)); + else + rc.SetColor(NS_RGB(0, 0, 255)); //hey, notice that these numbers don't add up... that's because //something funny happens on windows when the *right* numbers are diff --git a/view/src/nsViewManager.cpp b/view/src/nsViewManager.cpp index 0b20799148e5..44f1b6a045a5 100644 --- a/view/src/nsViewManager.cpp +++ b/view/src/nsViewManager.cpp @@ -241,7 +241,11 @@ NS_IMETHODIMP nsViewManager :: SetFrameRate(PRUint32 aFrameRate) if (aFrameRate != mFrameRate) { - NS_IF_RELEASE(mTimer); + if (nsnull != mTimer) + { + mTimer->Cancel(); //XXX this should not be necessary. MMP + NS_RELEASE(mTimer); + } mFrameRate = aFrameRate; mTrueFrameRate = aFrameRate; @@ -291,18 +295,8 @@ NS_IMETHODIMP nsViewManager :: SetWindowDimensions(nscoord width, nscoord height NS_IMETHODIMP nsViewManager :: ResetScrolling(void) { - if (nsnull != mRootView) - { - nsIScrollableView *scroller; - nsresult retval; - - retval = mRootView->QueryInterface(kIScrollableViewIID, (void **)&scroller); - if (NS_SUCCEEDED(retval)) { - scroller->ComputeContainerSize(); - } - - return retval; - } + if (nsnull != mRootScrollable) + mRootScrollable->ComputeContainerSize(); return NS_OK; } @@ -1700,71 +1694,26 @@ nsDrawingSurface nsViewManager :: GetDrawingSurface(nsIRenderingContext &aContex NS_IMETHODIMP nsViewManager :: ShowQuality(PRBool aShow) { - nsIScrollableView *scroller; - nsresult retval = NS_ERROR_FAILURE; + if (nsnull != mRootScrollable) + mRootScrollable->ShowQuality(aShow); - if (nsnull != mRootView) - { - nsIView *child; - - mRootView->GetChild(0, child); - - if (nsnull != child) - { - retval = child->QueryInterface(kIScrollableViewIID, (void **)&scroller); - - if (NS_SUCCEEDED(retval)) - scroller->ShowQuality(aShow); - } - } - - return retval; + return NS_OK; } NS_IMETHODIMP nsViewManager :: GetShowQuality(PRBool &aResult) { - nsIScrollableView *scroller; - nsresult retval = NS_ERROR_FAILURE; + if (nsnull != mRootScrollable) + mRootScrollable->GetShowQuality(aResult); - if (nsnull != mRootView) - { - nsIView *child; - - mRootView->GetChild(0, child); - - if (nsnull != child) - { - retval = child->QueryInterface(kIScrollableViewIID, (void **)&scroller); - - if (NS_SUCCEEDED(retval)) - scroller->GetShowQuality(aResult); - } - } - - return retval; + return NS_OK; } NS_IMETHODIMP nsViewManager :: SetQuality(nsContentQuality aQuality) { - nsIScrollableView *scroller; - nsresult retval = NS_ERROR_FAILURE; + if (nsnull != mRootScrollable) + mRootScrollable->SetQuality(aQuality); - if (nsnull != mRootView) - { - nsIView *child; - - mRootView->GetChild(0, child); - - if (nsnull != child) - { - retval = child->QueryInterface(kIScrollableViewIID, (void **)&scroller); - - if (NS_SUCCEEDED(retval)) - scroller->SetQuality(aQuality); - } - } - - return retval; + return NS_OK; } nsIRenderingContext * nsViewManager :: CreateRenderingContext(nsIView &aView)