Bug 950487 - Remove unnecessary UpdateCompositionBounds function on APZC. r=Cwiiis

This commit is contained in:
Kartikaya Gupta
2013-12-17 14:25:57 -05:00
parent 6962500778
commit c14ef68827
7 changed files with 0 additions and 112 deletions

View File

@@ -484,10 +484,6 @@ TabParent::UpdateDimensions(const nsRect& rect, const nsIntSize& size)
mOrientation = orientation; mOrientation = orientation;
unused << SendUpdateDimensions(mRect, mDimensions, mOrientation); unused << SendUpdateDimensions(mRect, mDimensions, mOrientation);
if (RenderFrameParent* rfp = GetRenderFrame()) {
rfp->NotifyDimensionsChanged(ScreenIntSize::FromUnknownSize(
gfx::IntSize(mDimensions.width, mDimensions.height)));
}
} }
} }
@@ -1687,12 +1683,6 @@ TabParent::RecvPRenderFrameConstructor(PRenderFrameParent* actor,
TextureFactoryIdentifier* factoryIdentifier, TextureFactoryIdentifier* factoryIdentifier,
uint64_t* layersId) uint64_t* layersId)
{ {
RenderFrameParent* rfp = GetRenderFrame();
if (mDimensions != nsIntSize() && rfp) {
rfp->NotifyDimensionsChanged(ScreenIntSize::FromUnknownSize(
gfx::IntSize(mDimensions.width, mDimensions.height)));
}
return true; return true;
} }

View File

@@ -553,20 +553,6 @@ APZCTreeManager::ReceiveInputEvent(WidgetInputEvent& aEvent,
} }
} }
void
APZCTreeManager::UpdateRootCompositionBounds(const uint64_t& aLayersId,
const ScreenIntRect& aCompositionBounds)
{
// There can be multiple root APZCs for a given layers id (e.g. tabs in
// a single-process setup) and in such a case we probably want to notify
// all of them.
nsTArray< nsRefPtr<AsyncPanZoomController> > rootApzcs;
GetRootAPZCsFor(aLayersId, &rootApzcs);
for (size_t i = 0; i < rootApzcs.Length(); i++) {
rootApzcs[i]->UpdateCompositionBounds(aCompositionBounds);
}
}
void void
APZCTreeManager::ZoomToRect(const ScrollableLayerGuid& aGuid, APZCTreeManager::ZoomToRect(const ScrollableLayerGuid& aGuid,
const CSSRect& aRect) const CSSRect& aRect)
@@ -774,17 +760,6 @@ APZCTreeManager::BuildOverscrollHandoffChain(const nsRefPtr<AsyncPanZoomControll
CompareByScrollPriority()); CompareByScrollPriority());
} }
void
APZCTreeManager::GetRootAPZCsFor(const uint64_t& aLayersId,
nsTArray< nsRefPtr<AsyncPanZoomController> >* aOutRootApzcs)
{
MonitorAutoLock lock(mTreeLock);
// The root may have siblings, check those too
for (AsyncPanZoomController* apzc = mRootApzc; apzc; apzc = apzc->GetPrevSibling()) {
FindRootAPZCs(apzc, aLayersId, aOutRootApzcs);
}
}
AsyncPanZoomController* AsyncPanZoomController*
APZCTreeManager::FindTargetAPZC(AsyncPanZoomController* aApzc, const ScrollableLayerGuid& aGuid) APZCTreeManager::FindTargetAPZC(AsyncPanZoomController* aApzc, const ScrollableLayerGuid& aGuid)
{ {
@@ -861,25 +836,6 @@ APZCTreeManager::GetAPZCAtPoint(AsyncPanZoomController* aApzc, const gfxPoint& a
return nullptr; return nullptr;
} }
void
APZCTreeManager::FindRootAPZCs(AsyncPanZoomController* aApzc,
const uint64_t& aLayersId,
nsTArray< nsRefPtr<AsyncPanZoomController> >* aOutRootApzcs)
{
mTreeLock.AssertCurrentThreadOwns();
if (aApzc->IsRootForLayersId(aLayersId)) {
aOutRootApzcs->AppendElement(aApzc);
// If this APZC is a root for this layers id then we know nothing else
// in the subtree rooted here will match so we can early-exit
return;
}
for (AsyncPanZoomController* child = aApzc->GetLastChild(); child; child = child->GetPrevSibling()) {
FindRootAPZCs(child, aLayersId, aOutRootApzcs);
}
}
/* This function sets the aTransformToApzcOut and aTransformToGeckoOut out-parameters /* This function sets the aTransformToApzcOut and aTransformToGeckoOut out-parameters
to some useful transformations that input events may need applied. This is best to some useful transformations that input events may need applied. This is best
illustrated with an example. Consider a chain of layers, L, M, N, O, P, Q, R. Layer L illustrated with an example. Consider a chain of layers, L, M, N, O, P, Q, R. Layer L

View File

@@ -134,17 +134,6 @@ public:
void TransformCoordinateToGecko(const ScreenIntPoint& aPoint, void TransformCoordinateToGecko(const ScreenIntPoint& aPoint,
LayoutDeviceIntPoint* aOutTransformedPoint); LayoutDeviceIntPoint* aOutTransformedPoint);
/**
* Updates the composition bounds on the root APZC for the given layers id.
* See FrameMetrics::mCompositionBounds for the definition of what the
* composition bounds are. This function is only meant for updating the
* composition bounds on the root APZC because that is the one that is
* zoomable, and the zoom may need to be adjusted immediately upon a change
* in the composition bounds.
*/
void UpdateRootCompositionBounds(const uint64_t& aLayersId,
const ScreenIntRect& aCompositionBounds);
/** /**
* Kicks an animation to zoom to a rect. This may be either a zoom out or zoom * Kicks an animation to zoom to a rect. This may be either a zoom out or zoom
* in. The actual animation is done on the compositor thread after being set * in. The actual animation is done on the compositor thread after being set
@@ -263,17 +252,12 @@ public:
*/ */
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScrollableLayerGuid& aGuid); already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScrollableLayerGuid& aGuid);
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScreenPoint& aPoint); already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScreenPoint& aPoint);
void GetRootAPZCsFor(const uint64_t& aLayersId,
nsTArray< nsRefPtr<AsyncPanZoomController> >* aOutRootApzcs);
void GetInputTransforms(AsyncPanZoomController *aApzc, gfx3DMatrix& aTransformToApzcOut, void GetInputTransforms(AsyncPanZoomController *aApzc, gfx3DMatrix& aTransformToApzcOut,
gfx3DMatrix& aTransformToGeckoOut); gfx3DMatrix& aTransformToGeckoOut);
private: private:
/* Helpers */ /* Helpers */
AsyncPanZoomController* FindTargetAPZC(AsyncPanZoomController* aApzc, const ScrollableLayerGuid& aGuid); AsyncPanZoomController* FindTargetAPZC(AsyncPanZoomController* aApzc, const ScrollableLayerGuid& aGuid);
AsyncPanZoomController* GetAPZCAtPoint(AsyncPanZoomController* aApzc, const gfxPoint& aHitTestPoint); AsyncPanZoomController* GetAPZCAtPoint(AsyncPanZoomController* aApzc, const gfxPoint& aHitTestPoint);
void FindRootAPZCs(AsyncPanZoomController* aApzc,
const uint64_t& aLayersId,
nsTArray< nsRefPtr<AsyncPanZoomController> >* aOutRootApzcs);
already_AddRefed<AsyncPanZoomController> CommonAncestor(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2); already_AddRefed<AsyncPanZoomController> CommonAncestor(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2);
already_AddRefed<AsyncPanZoomController> RootAPZCForLayersId(AsyncPanZoomController* aApzc); already_AddRefed<AsyncPanZoomController> RootAPZCForLayersId(AsyncPanZoomController* aApzc);
already_AddRefed<AsyncPanZoomController> GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent, ScreenPoint aPoint); already_AddRefed<AsyncPanZoomController> GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent, ScreenPoint aPoint);

View File

@@ -1483,28 +1483,6 @@ const FrameMetrics& AsyncPanZoomController::GetFrameMetrics() {
return mFrameMetrics; return mFrameMetrics;
} }
void AsyncPanZoomController::UpdateCompositionBounds(const ScreenIntRect& aCompositionBounds) {
ReentrantMonitorAutoEnter lock(mMonitor);
ScreenIntRect oldCompositionBounds = mFrameMetrics.mCompositionBounds;
mFrameMetrics.mCompositionBounds = aCompositionBounds;
// If the window had 0 dimensions before, or does now, we don't want to
// repaint or update the zoom since we'll run into rendering issues and/or
// divide-by-zero. This manifests itself as the screen flashing. If the page
// has gone out of view, the buffer will be cleared elsewhere anyways.
if (aCompositionBounds.width && aCompositionBounds.height &&
oldCompositionBounds.width && oldCompositionBounds.height) {
float adjustmentFactor = float(aCompositionBounds.width) / float(oldCompositionBounds.width);
mFrameMetrics.mZoom.scale =
clamped(mFrameMetrics.mZoom.scale * adjustmentFactor,
mMinZoom.scale, mMaxZoom.scale);
// Repaint on a rotation so that our new resolution gets properly updated.
RequestContentRepaint();
}
}
void AsyncPanZoomController::ZoomToRect(CSSRect aRect) { void AsyncPanZoomController::ZoomToRect(CSSRect aRect) {
SetState(ANIMATING_ZOOM); SetState(ANIMATING_ZOOM);

View File

@@ -104,15 +104,6 @@ public:
*/ */
nsEventStatus ReceiveInputEvent(const InputData& aEvent); nsEventStatus ReceiveInputEvent(const InputData& aEvent);
/**
* Updates the composition bounds, i.e. the dimensions of the final size of
* the frame this is tied to during composition onto, in device pixels. In
* general, this will just be:
* { x = 0, y = 0, width = surface.width, height = surface.height }, however
* there is no hard requirement for this.
*/
void UpdateCompositionBounds(const ScreenIntRect& aCompositionBounds);
/** /**
* Kicks an animation to zoom to a rect. This may be either a zoom out or zoom * Kicks an animation to zoom to a rect. This may be either a zoom out or zoom
* in. The actual animation is done on the compositor thread after being set * in. The actual animation is done on the compositor thread after being set

View File

@@ -910,15 +910,6 @@ RenderFrameParent::NotifyInputEvent(const WidgetInputEvent& aEvent,
} }
} }
void
RenderFrameParent::NotifyDimensionsChanged(ScreenIntSize size)
{
if (GetApzcTreeManager()) {
GetApzcTreeManager()->UpdateRootCompositionBounds(
mLayersId, ScreenIntRect(ScreenIntPoint(), size));
}
}
void void
RenderFrameParent::ActorDestroy(ActorDestroyReason why) RenderFrameParent::ActorDestroy(ActorDestroyReason why)
{ {

View File

@@ -110,8 +110,6 @@ public:
ScrollableLayerGuid* aOutTargetGuid, ScrollableLayerGuid* aOutTargetGuid,
WidgetInputEvent* aOutEvent); WidgetInputEvent* aOutEvent);
void NotifyDimensionsChanged(ScreenIntSize size);
void ZoomToRect(uint32_t aPresShellId, ViewID aViewId, const CSSRect& aRect); void ZoomToRect(uint32_t aPresShellId, ViewID aViewId, const CSSRect& aRect);
void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, void ContentReceivedTouch(const ScrollableLayerGuid& aGuid,