Bug 366001. Remove old reflow batching API, it's not effective or needed. r+sr=bzbarsky

This commit is contained in:
roc+%cs.cmu.edu 2007-01-17 22:28:33 +00:00
Родитель b5aa481aea
Коммит 23b8db0f54
3 изменённых файлов: 19 добавлений и 96 удалений

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

@ -4296,14 +4296,6 @@ nsresult nsEditor::BeginUpdateViewBatch()
if (mViewManager)
mViewManager->BeginUpdateViewBatch();
// Turn off reflow.
nsCOMPtr<nsIPresShell> presShell;
GetPresShell(getter_AddRefs(presShell));
if (presShell)
presShell->BeginReflowBatching();
}
mUpdateCount++;
@ -4344,26 +4336,7 @@ nsresult nsEditor::EndUpdateViewBatch()
GetFlags(&flags);
// Turn reflow back on.
//
// Make sure we enable reflowing before we call
// mViewManager->EndUpdateViewBatch(). This will make sure that any
// new updates caused by a reflow, that may happen during the
// EndReflowBatching(), get included if we force a refresh during
// the mViewManager->EndUpdateViewBatch() call.
if (presShell)
{
PRBool forceReflow = PR_TRUE;
if (flags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask)
forceReflow = PR_FALSE;
presShell->EndReflowBatching(forceReflow);
}
// Turn view updating back on.
if (mViewManager)
{
PRUint32 updateFlag = NS_VMREFRESH_IMMEDIATE;

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

@ -97,10 +97,10 @@ class nsWeakFrame;
typedef short SelectionType;
// 5A76F236-B93A-4C70-BC22-250F71C90518
// B6AFC710-43B8-4FD0-8B18-782FD621B270
#define NS_IPRESSHELL_IID \
{ 0x5a76f236, 0xb93a, 0x4c70, \
{ 0xbc, 0x22, 0x25, 0x0f, 0x71, 0xc9, 0x05, 0x18 } }
{ 0xb6afc710, 0x43b8, 0x4fd0, \
{ 0x8b, 0x18, 0x78, 0x2f, 0xd6, 0x21, 0xb2, 0x70 } }
// Constants uses for ScrollFrameIntoView() function
#define NS_PRESSHELL_SCROLL_TOP 0
@ -376,12 +376,6 @@ public:
NS_IMETHOD PostReflowCallback(nsIReflowCallback* aCallback) = 0;
NS_IMETHOD CancelReflowCallback(nsIReflowCallback* aCallback) = 0;
/**
* Reflow batching
*/
NS_IMETHOD BeginReflowBatching() = 0;
NS_IMETHOD EndReflowBatching(PRBool aFlushPendingReflows) = 0;
NS_IMETHOD GetReflowBatchingStatus(PRBool* aIsBatching) = 0;
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame) = 0;

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

@ -856,13 +856,6 @@ public:
NS_IMETHOD PostReflowCallback(nsIReflowCallback* aCallback);
NS_IMETHOD CancelReflowCallback(nsIReflowCallback* aCallback);
/**
* Reflow batching
*/
NS_IMETHOD BeginReflowBatching();
NS_IMETHOD EndReflowBatching(PRBool aFlushPendingReflows);
NS_IMETHOD GetReflowBatchingStatus(PRBool* aBatch);
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
NS_IMETHOD CreateRenderingContext(nsIFrame *aFrame,
nsIRenderingContext** aContext);
@ -1139,7 +1132,6 @@ protected:
nsCOMPtr<nsICaret> mCaret;
PRInt16 mSelectionFlags;
PRPackedBool mBatchReflows; // When set to true, the pres shell batches reflow commands.
PresShellViewEventListener *mViewEventListener;
FrameArena mFrameArena;
StackArena* mStackArena;
@ -3411,15 +3403,12 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty)
}
}
// Post a reflow event if we are not batching reflow commands.
if (!mBatchReflows) {
// If we're in the middle of a drag, process it right away (needed for mac,
// might as well do it on all platforms just to keep the code paths the same).
// XXXbz but how does this actually "process it right away"?
// Isn't this more like "never process it"?
if ( !IsDragInProgress() )
PostReflowEvent();
}
// If we're in the middle of a drag, process it right away (needed for mac,
// might as well do it on all platforms just to keep the code paths the same).
// XXXbz but how does this actually "process it right away"?
// Isn't this more like "never process it"?
if ( !IsDragInProgress() )
PostReflowEvent();
return NS_OK;
}
@ -4727,35 +4716,6 @@ PresShell::IsReflowLocked(PRBool* aIsReflowLocked)
return NS_OK;
}
NS_IMETHODIMP
PresShell::BeginReflowBatching()
{
mBatchReflows = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
PresShell::EndReflowBatching(PRBool aFlushPendingReflows)
{
nsresult rv = NS_OK;
mBatchReflows = PR_FALSE;
if (aFlushPendingReflows) {
rv = FlushPendingNotifications(Flush_OnlyReflow);
}
else {
PostReflowEvent();
}
return rv;
}
NS_IMETHODIMP
PresShell::GetReflowBatchingStatus(PRBool* aIsBatching)
{
*aIsBatching = mBatchReflows;
return NS_OK;
}
void
PresShell::CharacterDataChanged(nsIDocument *aDocument,
nsIContent* aContent,
@ -5938,22 +5898,18 @@ PresShell::ReflowEvent::Run() {
}
#endif
// NOTE: the ReflowEvent class is a friend of the PresShell class
PRBool isBatching;
ps->ClearReflowEventStatus();
ps->GetReflowBatchingStatus(&isBatching);
if (!isBatching) {
// Set a kung fu death grip on the view manager associated with the pres shell
// before processing that pres shell's reflow commands. Fixes bug 54868.
nsCOMPtr<nsIViewManager> viewManager = ps->GetViewManager();
NS_ENSURE_TRUE(viewManager, NS_OK);
viewManager->BeginUpdateViewBatch();
ps->ProcessReflowCommands(PR_TRUE);
viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
// Set a kung fu death grip on the view manager associated with the pres shell
// before processing that pres shell's reflow commands. Fixes bug 54868.
nsCOMPtr<nsIViewManager> viewManager = ps->GetViewManager();
NS_ENSURE_TRUE(viewManager, NS_OK);
viewManager->BeginUpdateViewBatch();
ps->ProcessReflowCommands(PR_TRUE);
viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
// Now, explicitly release the pres shell before the view manager
ps = nsnull;
viewManager = nsnull;
}
// Now, explicitly release the pres shell before the view manager
ps = nsnull;
viewManager = nsnull;
}
return NS_OK;
}