Bug 879004 - Convert the async scroll offset fields in APZC.h to CSSPoints. r=kentuckyfriedtakahe

This commit is contained in:
Kartikaya Gupta 2013-06-10 09:05:44 -04:00
Родитель 2e046cb0db
Коммит 6b80984b82
8 изменённых файлов: 22 добавлений и 23 удалений

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

@ -245,8 +245,8 @@ class DispatchAsyncScrollEventRunnable : public nsRunnable
{
public:
DispatchAsyncScrollEventRunnable(TabParent* aTabParent,
const gfx::Rect& aContentRect,
const gfx::Size& aContentSize)
const CSSRect& aContentRect,
const CSSSize& aContentSize)
: mTabParent(aTabParent)
, mContentRect(aContentRect)
, mContentSize(aContentSize)
@ -256,8 +256,8 @@ public:
private:
nsRefPtr<TabParent> mTabParent;
const gfx::Rect mContentRect;
const gfx::Size mContentSize;
const CSSRect mContentRect;
const CSSSize mContentSize;
};
NS_IMETHODIMP DispatchAsyncScrollEventRunnable::Run()
@ -277,8 +277,8 @@ NS_IMETHODIMP DispatchAsyncScrollEventRunnable::Run()
bool
BrowserElementParent::DispatchAsyncScrollEvent(TabParent* aTabParent,
const gfx::Rect& aContentRect,
const gfx::Size& aContentSize)
const CSSRect& aContentRect,
const CSSSize& aContentSize)
{
nsRefPtr<DispatchAsyncScrollEventRunnable> runnable =
new DispatchAsyncScrollEventRunnable(aTabParent, aContentRect,

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

@ -8,6 +8,7 @@
#include "nsAString.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/gfx/Rect.h"
#include "Units.h"
class nsIDOMWindow;
class nsIURI;
@ -106,8 +107,8 @@ public:
*/
static bool
DispatchAsyncScrollEvent(dom::TabParent* aTabParent,
const gfx::Rect& aContentRect,
const gfx::Size& aContentSize);
const CSSRect& aContentRect,
const CSSSize& aContentSize);
};
} // namespace mozilla

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

@ -1176,7 +1176,7 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa
}
scrollOffset = gfxPoint(mFrameMetrics.mScrollOffset.x, mFrameMetrics.mScrollOffset.y);
mCurrentAsyncScrollOffset = mFrameMetrics.mScrollOffset.ToUnknownPoint();
mCurrentAsyncScrollOffset = mFrameMetrics.mScrollOffset;
}
// Cancel the mAsyncScrollTimeoutTask because we will fire a
@ -1493,13 +1493,11 @@ void AsyncPanZoomController::SendAsyncScrollEvent() {
return;
}
gfx::Rect contentRect;
gfx::Size scrollableSize;
CSSRect contentRect;
CSSSize scrollableSize;
{
scrollableSize = gfx::Size(mFrameMetrics.mScrollableRect.width,
mFrameMetrics.mScrollableRect.height);
contentRect = AsyncPanZoomController::CalculateCompositedRectInCssPixels(mFrameMetrics)
.ToUnknownRect();
scrollableSize = mFrameMetrics.mScrollableRect.Size();
contentRect = AsyncPanZoomController::CalculateCompositedRectInCssPixels(mFrameMetrics);
contentRect.MoveTo(mCurrentAsyncScrollOffset);
}

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

@ -568,11 +568,11 @@ private:
// The last time and offset we fire the mozbrowserasyncscroll event when
// compositor has sampled the content transform for this frame.
TimeStamp mLastAsyncScrollTime;
gfx::Point mLastAsyncScrollOffset;
CSSPoint mLastAsyncScrollOffset;
// The current offset drawn on the screen, it may not be sent since we have
// throttling policy for mozbrowserasyncscroll event.
gfx::Point mCurrentAsyncScrollOffset;
CSSPoint mCurrentAsyncScrollOffset;
// The delay task triggered by the throttling mozbrowserasyncscroll event
// ensures the last mozbrowserasyncscroll event is always been fired.

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

@ -51,8 +51,8 @@ public:
* |aContentRect| is in CSS pixels, relative to the current cssPage.
* |aScrollableSize| is the current content width/height in CSS pixels.
*/
virtual void SendAsyncScrollDOMEvent(const gfx::Rect &aContentRect,
const gfx::Size &aScrollableSize) = 0;
virtual void SendAsyncScrollDOMEvent(const CSSRect &aContentRect,
const CSSSize &aScrollableSize) = 0;
/**
* Schedules a runnable to run on the controller/UI thread at some time

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

@ -552,8 +552,8 @@ public:
void ClearRenderFrame() { mRenderFrame = nullptr; }
virtual void SendAsyncScrollDOMEvent(const gfx::Rect& aContentRect,
const gfx::Size& aContentSize) MOZ_OVERRIDE
virtual void SendAsyncScrollDOMEvent(const CSSRect& aContentRect,
const CSSSize& aContentSize) MOZ_OVERRIDE
{
if (MessageLoop::current() != mUILoop) {
mUILoop->PostTask(

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

@ -2820,7 +2820,7 @@ AndroidBridge::HandleLongTap(const nsIntPoint& aPoint)
}
void
AndroidBridge::SendAsyncScrollDOMEvent(const gfx::Rect& aContentRect, const gfx::Size& aScrollableSize)
AndroidBridge::SendAsyncScrollDOMEvent(const CSSRect& aContentRect, const CSSSize& aScrollableSize)
{
// FIXME implement this
}

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

@ -599,7 +599,7 @@ public:
void HandleDoubleTap(const nsIntPoint& aPoint) MOZ_OVERRIDE;
void HandleSingleTap(const nsIntPoint& aPoint) MOZ_OVERRIDE;
void HandleLongTap(const nsIntPoint& aPoint) MOZ_OVERRIDE;
void SendAsyncScrollDOMEvent(const gfx::Rect& aContentRect, const gfx::Size& aScrollableSize) MOZ_OVERRIDE;
void SendAsyncScrollDOMEvent(const CSSRect& aContentRect, const CSSSize& aScrollableSize) MOZ_OVERRIDE;
void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE;
int64_t RunDelayedTasks();
};