Bug 1057578 - Change the overscroll transform exposed by APZC from a ViewTransform to a Matrix4x4. r=kats

This commit is contained in:
Botond Ballo 2014-08-29 14:41:49 -04:00
Родитель 95718593db
Коммит 0f34790a9a
4 изменённых файлов: 14 добавлений и 12 удалений

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

@ -2184,7 +2184,7 @@ bool AsyncPanZoomController::UpdateAnimation(const TimeStamp& aSampleTime,
return false;
}
void AsyncPanZoomController::GetOverscrollTransform(ViewTransform* aTransform) const {
void AsyncPanZoomController::GetOverscrollTransform(Matrix4x4* aTransform) const {
// The overscroll effect is a combination of a translation in
// the direction of overscroll, and shrinking in both directions.
// With the effect applied, we can think of the composited region as being
@ -2265,9 +2265,10 @@ void AsyncPanZoomController::GetOverscrollTransform(ViewTransform* aTransform) c
float scale = 1 - (kZEffect * spaceProp);
// Finally, apply the transformations.
aTransform->mScale.scale *= scale;
aTransform->mTranslation += translation * mFrameMetrics.GetZoom();
// Finally, create a matrix representing the transformations.
ScreenPoint screenTranslation = translation * mFrameMetrics.GetZoom();
*aTransform = Matrix4x4().Scale(scale, scale, 1)
.PostTranslate(screenTranslation.x, screenTranslation.y, 0);
}
bool AsyncPanZoomController::AdvanceAnimations(const TimeStamp& aSampleTime)
@ -2336,7 +2337,7 @@ bool AsyncPanZoomController::AdvanceAnimations(const TimeStamp& aSampleTime)
void AsyncPanZoomController::SampleContentTransformForFrame(ViewTransform* aOutTransform,
ScreenPoint& aScrollOffset,
ViewTransform* aOutOverscrollTransform)
Matrix4x4* aOutOverscrollTransform)
{
ReentrantMonitorAutoEnter lock(mMonitor);

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

@ -175,7 +175,7 @@ public:
*/
void SampleContentTransformForFrame(ViewTransform* aOutTransform,
ScreenPoint& aScrollOffset,
ViewTransform* aOutOverscrollTransform);
Matrix4x4* aOutOverscrollTransform);
/**
* A shadow layer update has arrived. |aLayerMetrics| is the new FrameMetrics
@ -576,7 +576,7 @@ private:
* Return in |aTransform| a visual effect that reflects this apzc's
* overscrolled state, if any.
*/
void GetOverscrollTransform(ViewTransform* aTransform) const;
void GetOverscrollTransform(Matrix4x4* aTransform) const;
enum AxisLockMode {
FREE, /* No locking at all */

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

@ -567,7 +567,8 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer)
hasAsyncTransform = true;
ViewTransform asyncTransformWithoutOverscroll, overscrollTransform;
ViewTransform asyncTransformWithoutOverscroll;
Matrix4x4 overscrollTransform;
ScreenPoint scrollOffset;
controller->SampleContentTransformForFrame(&asyncTransformWithoutOverscroll,
scrollOffset,
@ -591,7 +592,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer)
mLayerManager->GetCompositor()->SetScreenRenderOffset(offset);
combinedAsyncTransformWithoutOverscroll *= asyncTransformWithoutOverscroll;
combinedAsyncTransform *= (asyncTransformWithoutOverscroll * overscrollTransform);
combinedAsyncTransform *= (Matrix4x4(asyncTransformWithoutOverscroll) * overscrollTransform);
}
if (hasAsyncTransform) {

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

@ -160,11 +160,11 @@ public:
bool SampleContentTransformForFrame(const TimeStamp& aSampleTime,
ViewTransform* aOutTransform,
ScreenPoint& aScrollOffset,
ViewTransform* aOutOverscrollTransform = nullptr) {
ScreenPoint& aScrollOffset) {
Matrix4x4 aOverscrollTransform; // ignored
bool ret = AdvanceAnimations(aSampleTime);
AsyncPanZoomController::SampleContentTransformForFrame(
aOutTransform, aScrollOffset, aOutOverscrollTransform);
aOutTransform, aScrollOffset, &aOverscrollTransform);
return ret;
}
};