mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 748048 - Part 1: Remove SetInvalidationDimensions and GetInvalidationDimensions. r=roc
This commit is contained in:
parent
16f7a14985
commit
d068bda688
@ -331,19 +331,6 @@ nsDOMWindowUtils::SetDisplayPortForElement(float aXPx, float aYPx,
|
||||
// We are setting a root displayport for a document.
|
||||
// The pres shell needs a special flag set.
|
||||
presShell->SetIgnoreViewportScrolling(true);
|
||||
|
||||
// The root document currently has a widget, but we might end up
|
||||
// painting content inside the displayport but outside the widget
|
||||
// bounds. This ensures the document's view honors invalidations
|
||||
// within the displayport.
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext && presContext->IsRoot()) {
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
nsIView* view = rootFrame->GetView();
|
||||
if (view) {
|
||||
view->SetInvalidationDimensions(&displayport);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4553,6 +4553,10 @@ void
|
||||
nsIFrame::InvalidateInternalAfterResize(const nsRect& aDamageRect, nscoord aX,
|
||||
nscoord aY, PRUint32 aFlags)
|
||||
{
|
||||
if (aDamageRect.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we're a transformed frame, then we need to apply our transform to the
|
||||
* damage rectangle so that the redraw correctly redraws the transformed
|
||||
* region. We're moved over aX and aY from our origin, but since this aX
|
||||
|
@ -63,8 +63,8 @@ enum nsViewVisibility {
|
||||
};
|
||||
|
||||
#define NS_IVIEW_IID \
|
||||
{ 0xda62efbf, 0x0711, 0x4b79, \
|
||||
{ 0x87, 0x85, 0x9e, 0xec, 0xed, 0xf5, 0xb0, 0x32 } }
|
||||
{ 0x697948d2, 0x3f10, 0x407d, \
|
||||
{ 0xb8, 0x94, 0x9f, 0x36, 0xd2, 0x11, 0xdb, 0xf1 } }
|
||||
|
||||
// Public view flags
|
||||
|
||||
@ -167,17 +167,6 @@ public:
|
||||
nsRect r = mDimBounds; r.MoveBy(-mPosX, -mPosY); return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the dimensions at which invalidations are clipped, which can
|
||||
* be different than |GetDimensions()|. |aRect| is relative to
|
||||
* |this|. It can be null, in which case invalidations return to
|
||||
* being clipped to the view dimensions.
|
||||
*
|
||||
* The caller is responsible for invalidating the area that may lie
|
||||
* outside the view dimensions but inside |aRect| after this call.
|
||||
*/
|
||||
void SetInvalidationDimensions(const nsRect* aRect);
|
||||
|
||||
/**
|
||||
* Get the offset between the coordinate systems of |this| and aOther.
|
||||
* Adding the return value to a point in the coordinate system of |this|
|
||||
|
@ -206,7 +206,6 @@ nsView::nsView(nsViewManager* aViewManager, nsViewVisibility aVisibility)
|
||||
mViewManager = aViewManager;
|
||||
mDirtyRegion = nsnull;
|
||||
mDeletionObserver = nsnull;
|
||||
mHaveInvalidationDimensions = false;
|
||||
mWidgetIsTopLevel = false;
|
||||
}
|
||||
|
||||
@ -355,11 +354,6 @@ void nsView::SetPosition(nscoord aX, nscoord aY)
|
||||
ResetWidgetBounds(true, false);
|
||||
}
|
||||
|
||||
void nsIView::SetInvalidationDimensions(const nsRect* aRect)
|
||||
{
|
||||
return Impl()->SetInvalidationDimensions(aRect);
|
||||
}
|
||||
|
||||
void nsView::ResetWidgetBounds(bool aRecurse, bool aForceSync)
|
||||
{
|
||||
if (mWindow) {
|
||||
@ -498,13 +492,6 @@ void nsView::SetDimensions(const nsRect& aRect, bool aPaint, bool aResizeWidget)
|
||||
}
|
||||
}
|
||||
|
||||
void nsView::SetInvalidationDimensions(const nsRect* aRect)
|
||||
{
|
||||
if ((mHaveInvalidationDimensions = !!aRect)) {
|
||||
mInvalidationDimensions = *aRect;
|
||||
}
|
||||
}
|
||||
|
||||
void nsView::NotifyEffectiveVisibilityChanged(bool aEffectivelyVisible)
|
||||
{
|
||||
if (!aEffectivelyVisible)
|
||||
|
@ -76,7 +76,6 @@ public:
|
||||
*/
|
||||
virtual void SetDimensions(const nsRect &aRect, bool aPaint = true,
|
||||
bool aResizeWidget = true);
|
||||
void SetInvalidationDimensions(const nsRect* aRect);
|
||||
|
||||
/**
|
||||
* Called to indicate that the visibility of a view has been
|
||||
@ -149,10 +148,6 @@ public:
|
||||
// Same as GetBounds but converts to parent appunits if they are different.
|
||||
nsRect GetBoundsInParentUnits() const;
|
||||
|
||||
nsRect GetInvalidationDimensions() const {
|
||||
return mHaveInvalidationDimensions ? mInvalidationDimensions : GetDimensions();
|
||||
}
|
||||
|
||||
// These are defined exactly the same in nsIView, but for now they have to be redeclared
|
||||
// here because of stupid C++ method hiding rules
|
||||
|
||||
@ -205,13 +200,6 @@ protected:
|
||||
void DoResetWidgetBounds(bool aMoveOnly, bool aInvalidateChangedSize);
|
||||
|
||||
nsRegion* mDirtyRegion;
|
||||
// invalidations are clipped to mInvalidationDimensions, not
|
||||
// GetDimensions(), when mHaveInvalidationDimensions is true. This
|
||||
// is used to support persistent "displayport" rendering; see
|
||||
// nsPresShell.cpp. The coordinates of mInvalidationDimensions are
|
||||
// relative to |this|.
|
||||
nsRect mInvalidationDimensions;
|
||||
bool mHaveInvalidationDimensions;
|
||||
|
||||
private:
|
||||
void InitializeWindow(bool aEnableDragDrop, bool aResetVisibility);
|
||||
|
@ -479,13 +479,6 @@ nsViewManager::InvalidateWidgetArea(nsView *aWidgetView,
|
||||
widget, dbgBounds.x, dbgBounds.y, dbgBounds.width, dbgBounds.height);
|
||||
#endif
|
||||
|
||||
// If the bounds don't overlap at all, there's nothing to do
|
||||
nsRegion intersection;
|
||||
intersection.And(aWidgetView->GetInvalidationDimensions(), aDamagedRegion);
|
||||
if (intersection.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the widget is hidden, it don't cover nothing
|
||||
if (widget) {
|
||||
bool visible;
|
||||
@ -542,7 +535,7 @@ nsViewManager::InvalidateWidgetArea(nsView *aWidgetView,
|
||||
}
|
||||
|
||||
nsRegion leftOver;
|
||||
leftOver.Sub(intersection, children);
|
||||
leftOver.Sub(aDamagedRegion, children);
|
||||
|
||||
if (!leftOver.IsEmpty()) {
|
||||
const nsRect* r;
|
||||
@ -1320,13 +1313,8 @@ nsIntRect nsViewManager::ViewToWidget(nsView *aView, const nsRect &aRect) const
|
||||
{
|
||||
NS_ASSERTION(aView->GetViewManager() == this, "wrong view manager");
|
||||
|
||||
// intersect aRect with bounds of aView, to prevent generating any illegal rectangles.
|
||||
nsRect bounds = aView->GetInvalidationDimensions();
|
||||
nsRect rect;
|
||||
rect.IntersectRect(aRect, bounds);
|
||||
|
||||
// account for the view's origin not lining up with the widget's
|
||||
rect += aView->ViewToWidgetOffset();
|
||||
nsRect rect = aRect + aView->ViewToWidgetOffset();
|
||||
|
||||
// finally, convert to device coordinates.
|
||||
return rect.ToOutsidePixels(AppUnitsPerDevPixel());
|
||||
|
Loading…
Reference in New Issue
Block a user