mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 572900. Part 1: Remove view cruft that's not needed now that scrolling is layer-based. r=tnikkel
This commit is contained in:
parent
c5362bf642
commit
00f2a44ddc
@ -50,8 +50,8 @@ class nsIDeviceContext;
|
||||
class nsIViewObserver;
|
||||
|
||||
#define NS_IVIEWMANAGER_IID \
|
||||
{ 0xbbdd429c, 0x6542, 0x477a, \
|
||||
{ 0xab, 0x48, 0x6c, 0xd6, 0xcb, 0xb8, 0xdf, 0x98 } }
|
||||
{ 0x9e924719, 0x3c4b, 0x435b, \
|
||||
{ 0xaf, 0x1e, 0x71, 0x52, 0x04, 0x6d, 0xaa, 0x44 } }
|
||||
|
||||
class nsIViewManager : public nsISupports
|
||||
{
|
||||
@ -388,42 +388,6 @@ public:
|
||||
* (aFromScroll is false) or scrolled (aFromScroll is true).
|
||||
*/
|
||||
NS_IMETHOD SynthesizeMouseMove(PRBool aFromScroll)=0;
|
||||
|
||||
/**
|
||||
* Called to inform the view manager that a view is about to bit-blit.
|
||||
* @param aView the view that will bit-blit
|
||||
* @param aScrollAmount how much aView will scroll by
|
||||
* @return always returns NS_OK
|
||||
* @note
|
||||
* This method used to return void, but MSVC 6.0 SP5 (without the
|
||||
* Processor Pack) and SP6, and the MS eMbedded Visual C++ 4.0 SP4
|
||||
* (for WINCE) hit an internal compiler error when compiling this
|
||||
* method:
|
||||
*
|
||||
* @par
|
||||
@verbatim
|
||||
fatal error C1001: INTERNAL COMPILER ERROR
|
||||
(compiler file 'E:\8966\vc98\p2\src\P2\main.c', line 494)
|
||||
@endverbatim
|
||||
*
|
||||
* @par
|
||||
* Making the method return nsresult worked around the internal
|
||||
* compiler error. See Bugzilla bug 281158. (The WINCE internal
|
||||
* compiler error was addressed by the patch in bug 291229 comment
|
||||
* 14 although the bug report did not mention the problem.)
|
||||
*/
|
||||
virtual nsresult WillBitBlit(nsIView* aView, const nsRect& aRect,
|
||||
nsPoint aScrollAmount) = 0;
|
||||
|
||||
/**
|
||||
* Called to inform the view manager that a view has scrolled via a
|
||||
* bitblit.
|
||||
* The view manager will invalidate any widgets which may need
|
||||
* to be rerendered.
|
||||
* @param aView view to paint
|
||||
* @param aUpdateRegion ensure that this part of the view is repainted
|
||||
*/
|
||||
virtual void UpdateViewAfterScroll(nsIView *aView, const nsRegion& aUpdateRegion) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIViewManager, NS_IVIEWMANAGER_IID)
|
||||
|
@ -511,62 +511,6 @@ NS_IMETHODIMP nsViewManager::UpdateView(nsIView *aView, PRUint32 aUpdateFlags)
|
||||
return UpdateView(view, bounds, aUpdateFlags);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsViewManager::WillBitBlit(nsIView* aView, const nsRect& aRect,
|
||||
nsPoint aCopyDelta)
|
||||
{
|
||||
if (!IsRootVM()) {
|
||||
RootViewManager()->WillBitBlit(aView, aRect, aCopyDelta);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// aView must be a display root
|
||||
NS_PRECONDITION(aView &&
|
||||
(aView == mRootView || aView->GetFloating()),
|
||||
"Must have a display root view");
|
||||
|
||||
++mScrollCnt;
|
||||
|
||||
nsView* v = static_cast<nsView*>(aView);
|
||||
if (v->HasNonEmptyDirtyRegion()) {
|
||||
nsRegion* dirty = v->GetDirtyRegion();
|
||||
nsRegion intersection = *dirty;
|
||||
intersection.MoveBy(-aCopyDelta);
|
||||
intersection.And(intersection, aRect);
|
||||
if (!intersection.IsEmpty()) {
|
||||
dirty->Or(*dirty, intersection);
|
||||
// Random simplification number...
|
||||
dirty->SimplifyOutward(20);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Invalidate all widgets which overlap the view, other than the view's own widgets.
|
||||
void
|
||||
nsViewManager::UpdateViewAfterScroll(nsIView *aView,
|
||||
const nsRegion& aUpdateRegion)
|
||||
{
|
||||
NS_ASSERTION(RootViewManager()->mScrollCnt > 0,
|
||||
"Someone forgot to call WillBitBlit()");
|
||||
// No need to check for empty aUpdateRegion here. We'd still need to
|
||||
// do most of the work here anyway.
|
||||
|
||||
nsView* view = static_cast<nsView*>(aView);
|
||||
nsView* displayRoot = GetDisplayRootFor(view);
|
||||
nsPoint offset = view->GetOffsetTo(displayRoot);
|
||||
nsRegion update(aUpdateRegion);
|
||||
update.MoveBy(offset);
|
||||
|
||||
nsViewManager* displayRootVM = displayRoot->GetViewManager();
|
||||
displayRootVM->UpdateWidgetArea(displayRoot, displayRoot->GetWidget(),
|
||||
update, nsnull);
|
||||
// FlushPendingInvalidates();
|
||||
|
||||
Composite();
|
||||
--RootViewManager()->mScrollCnt;
|
||||
}
|
||||
|
||||
static PRBool
|
||||
IsWidgetDrawnByPlugin(nsIWidget* aWidget, nsIView* aView)
|
||||
{
|
||||
@ -815,24 +759,22 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
// If an ancestor widget was hidden and then shown, we could
|
||||
// have a delayed resize to handle.
|
||||
PRBool didResize = PR_FALSE;
|
||||
if (rootVM->mScrollCnt == 0) {
|
||||
for (nsViewManager *vm = this; vm;
|
||||
vm = vm->mRootView->GetParent()
|
||||
? vm->mRootView->GetParent()->GetViewManager()
|
||||
: nsnull) {
|
||||
if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
|
||||
IsViewVisible(vm->mRootView)) {
|
||||
vm->FlushDelayedResize();
|
||||
for (nsViewManager *vm = this; vm;
|
||||
vm = vm->mRootView->GetParent()
|
||||
? vm->mRootView->GetParent()->GetViewManager()
|
||||
: nsnull) {
|
||||
if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
|
||||
IsViewVisible(vm->mRootView)) {
|
||||
vm->FlushDelayedResize();
|
||||
|
||||
// Paint later.
|
||||
vm->UpdateView(vm->mRootView, NS_VMREFRESH_NO_SYNC);
|
||||
didResize = PR_TRUE;
|
||||
// Paint later.
|
||||
vm->UpdateView(vm->mRootView, NS_VMREFRESH_NO_SYNC);
|
||||
didResize = PR_TRUE;
|
||||
|
||||
// not sure if it's valid for us to claim that we
|
||||
// ignored this, but we're going to do so anyway, since
|
||||
// we didn't actually paint anything
|
||||
*aStatus = nsEventStatus_eIgnore;
|
||||
}
|
||||
// not sure if it's valid for us to claim that we
|
||||
// ignored this, but we're going to do so anyway, since
|
||||
// we didn't actually paint anything
|
||||
*aStatus = nsEventStatus_eIgnore;
|
||||
}
|
||||
}
|
||||
|
||||
@ -849,7 +791,7 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
transparentWindow = widget->GetTransparencyMode() == eTransparencyTransparent;
|
||||
|
||||
nsView* view = static_cast<nsView*>(aView);
|
||||
if (rootVM->mScrollCnt == 0 && !transparentWindow) {
|
||||
if (!transparentWindow) {
|
||||
nsIViewObserver* observer = GetViewObserver();
|
||||
if (observer) {
|
||||
// Do an update view batch. Make sure not to do it DEFERRED,
|
||||
@ -1589,17 +1531,14 @@ nsViewManager::FlushPendingInvalidates()
|
||||
// we don't go through two invalidate-processing cycles).
|
||||
NS_ASSERTION(gViewManagers, "Better have a viewmanagers array!");
|
||||
|
||||
// Make sure to not send WillPaint notifications while scrolling
|
||||
if (mScrollCnt == 0) {
|
||||
// Disable refresh while we notify our view observers, so that if they do
|
||||
// view update batches we don't reenter this code and so that we batch
|
||||
// all of them together. We don't use
|
||||
// BeginUpdateViewBatch/EndUpdateViewBatch, since that would reenter this
|
||||
// exact code, but we want the effect of a single big update batch.
|
||||
++mUpdateBatchCnt;
|
||||
CallWillPaintOnObservers();
|
||||
--mUpdateBatchCnt;
|
||||
}
|
||||
// Disable refresh while we notify our view observers, so that if they do
|
||||
// view update batches we don't reenter this code and so that we batch
|
||||
// all of them together. We don't use
|
||||
// BeginUpdateViewBatch/EndUpdateViewBatch, since that would reenter this
|
||||
// exact code, but we want the effect of a single big update batch.
|
||||
++mUpdateBatchCnt;
|
||||
CallWillPaintOnObservers();
|
||||
--mUpdateBatchCnt;
|
||||
|
||||
if (mHasPendingUpdates) {
|
||||
ProcessPendingUpdates(mRootView, PR_TRUE);
|
||||
|
@ -251,11 +251,6 @@ public: // NOT in nsIViewManager, so private to the view module
|
||||
|
||||
nsEventStatus HandleEvent(nsView* aView, nsGUIEvent* aEvent);
|
||||
|
||||
virtual nsresult WillBitBlit(nsIView* aView, const nsRect& aRect,
|
||||
nsPoint aScrollAmount);
|
||||
virtual void UpdateViewAfterScroll(nsIView *aView,
|
||||
const nsRegion& aUpdateRegion);
|
||||
|
||||
nsresult CreateRegion(nsIRegion* *result);
|
||||
|
||||
PRBool IsRefreshEnabled() { return RootViewManager()->mUpdateBatchCnt == 0; }
|
||||
@ -298,7 +293,6 @@ private:
|
||||
PRInt32 mUpdateCnt;
|
||||
PRInt32 mUpdateBatchCnt;
|
||||
PRUint32 mUpdateBatchFlags;
|
||||
PRInt32 mScrollCnt;
|
||||
// Use IsPainting() and SetPainting() to access mPainting.
|
||||
PRPackedBool mPainting;
|
||||
PRPackedBool mRecursiveRefreshPending;
|
||||
|
Loading…
Reference in New Issue
Block a user