Bug 1180295 - Rip out the Fennec code to set the screen render offset. r=rbarker

--HG--
extra : commitid : 3e4iu6iVnfs
This commit is contained in:
Kartikaya Gupta 2015-08-18 14:27:18 -04:00
parent 056c55b10f
commit b4105053c9
8 changed files with 12 additions and 105 deletions

View File

@ -640,7 +640,6 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer)
}
const FrameMetrics& metrics = aLayer->GetFrameMetrics(i);
ScreenPoint offset(0, 0);
// TODO: When we enable APZ on Fennec, we'll need to call SyncFrameMetrics here.
// When doing so, it might be useful to look at how it was called here before
// bug 1036967 removed the (dead) call.
@ -659,9 +658,6 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer)
mIsFirstPaint = false;
mLayersUpdated = false;
// Apply the render offset
mLayerManager->GetCompositor()->SetScreenRenderOffset(offset);
// Transform the current local clip by this APZC's async transform. If we're
// using containerful scrolling, then the clip is not part of the scrolled
// frame and should not be transformed.
@ -1017,7 +1013,6 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer)
displayPort += scrollOffsetLayerPixels;
LayerMargin fixedLayerMargins(0, 0, 0, 0);
ScreenPoint offset(0, 0);
// Ideally we would initialize userZoom to AsyncPanZoomController::CalculateResolution(metrics)
// but this causes a reftest-ipc test to fail (see bug 883646 comment 27). The reason for this
@ -1031,13 +1026,9 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer)
* LayerToParentLayerScale(1));
ParentLayerPoint userScroll = metrics.GetScrollOffset() * userZoom;
SyncViewportInfo(displayPort, geckoZoom, mLayersUpdated,
userScroll, userZoom, fixedLayerMargins,
offset);
userScroll, userZoom, fixedLayerMargins);
mLayersUpdated = false;
// Apply the render offset
mLayerManager->GetCompositor()->SetScreenRenderOffset(offset);
// Handle transformations for asynchronous panning and zooming. We determine the
// zoom used by Gecko from the transformation set on the root layer, and we
// determine the scroll offset used by Gecko from the frame metrics of the
@ -1189,8 +1180,7 @@ AsyncCompositionManager::SyncViewportInfo(const LayerIntRect& aDisplayPort,
bool aLayersUpdated,
ParentLayerPoint& aScrollOffset,
CSSToParentLayerScale& aScale,
LayerMargin& aFixedLayerMargins,
ScreenPoint& aOffset)
LayerMargin& aFixedLayerMargins)
{
#ifdef MOZ_WIDGET_ANDROID
AndroidBridge::Bridge()->SyncViewportInfo(aDisplayPort,
@ -1198,8 +1188,7 @@ AsyncCompositionManager::SyncViewportInfo(const LayerIntRect& aDisplayPort,
aLayersUpdated,
aScrollOffset,
aScale,
aFixedLayerMargins,
aOffset);
aFixedLayerMargins);
#endif
}
@ -1211,14 +1200,13 @@ AsyncCompositionManager::SyncFrameMetrics(const ParentLayerPoint& aScrollOffset,
const CSSRect& aDisplayPort,
const CSSToLayerScale& aDisplayResolution,
bool aIsFirstPaint,
LayerMargin& aFixedLayerMargins,
ScreenPoint& aOffset)
LayerMargin& aFixedLayerMargins)
{
#ifdef MOZ_WIDGET_ANDROID
AndroidBridge::Bridge()->SyncFrameMetrics(aScrollOffset, aZoom, aCssPageRect,
aLayersUpdated, aDisplayPort,
aDisplayResolution, aIsFirstPaint,
aFixedLayerMargins, aOffset);
aFixedLayerMargins);
#endif
}

View File

@ -141,8 +141,7 @@ private:
bool aLayersUpdated,
ParentLayerPoint& aScrollOffset,
CSSToParentLayerScale& aScale,
LayerMargin& aFixedLayerMargins,
ScreenPoint& aOffset);
LayerMargin& aFixedLayerMargins);
void SyncFrameMetrics(const ParentLayerPoint& aScrollOffset,
float aZoom,
const CSSRect& aCssPageRect,
@ -150,8 +149,7 @@ private:
const CSSRect& aDisplayPort,
const CSSToLayerScale& aDisplayResolution,
bool aIsFirstPaint,
LayerMargin& aFixedLayerMargins,
ScreenPoint& aOffset);
LayerMargin& aFixedLayerMargins);
/**
* Adds a translation to the transform of any fixed position (whose parent

View File

@ -679,17 +679,9 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
mCurrentViewTransform.fixedLayerMarginRight = mCurrentViewTransformMargins.right;
mCurrentViewTransform.fixedLayerMarginBottom = mCurrentViewTransformMargins.bottom;
// Offset the view transform so that it renders in the correct place.
PointF offset = mFrameMetrics.getMarginOffset();
mCurrentViewTransform.offsetX = offset.x;
mCurrentViewTransform.offsetY = offset.y;
if (mRootLayer != null) {
mRootLayer.setPositionAndResolution(
Math.round(x + mCurrentViewTransform.offsetX),
Math.round(y + mCurrentViewTransform.offsetY),
Math.round(x + width + mCurrentViewTransform.offsetX),
Math.round(y + height + mCurrentViewTransform.offsetY),
x, y, x + width, y + height,
resolution);
}

View File

@ -16,8 +16,6 @@ public class ViewTransform {
public float fixedLayerMarginTop;
public float fixedLayerMarginRight;
public float fixedLayerMarginBottom;
public float offsetX;
public float offsetY;
public ViewTransform(float inX, float inY, float inScale) {
x = inX;

View File

@ -1455,7 +1455,7 @@ AndroidBridge::SetPageRect(const CSSRect& aCssPageRect)
void
AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
bool aLayersUpdated, ParentLayerPoint& aScrollOffset, CSSToParentLayerScale& aScale,
LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset)
LayerMargin& aFixedLayerMargins)
{
if (!mLayerClient) {
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
@ -1475,13 +1475,11 @@ AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, const CSSToLay
aFixedLayerMargins.right = viewTransform->FixedLayerMarginRight();
aFixedLayerMargins.bottom = viewTransform->FixedLayerMarginBottom();
aFixedLayerMargins.left = viewTransform->FixedLayerMarginLeft();
aOffset.x = viewTransform->OffsetX();
aOffset.y = viewTransform->OffsetY();
}
void AndroidBridge::SyncFrameMetrics(const ParentLayerPoint& aScrollOffset, float aZoom, const CSSRect& aCssPageRect,
bool aLayersUpdated, const CSSRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
bool aIsFirstPaint, LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset)
bool aIsFirstPaint, LayerMargin& aFixedLayerMargins)
{
if (!mLayerClient) {
ALOG_BRIDGE("Exceptional Exit: %s", __PRETTY_FUNCTION__);
@ -1505,9 +1503,6 @@ void AndroidBridge::SyncFrameMetrics(const ParentLayerPoint& aScrollOffset, floa
aFixedLayerMargins.right = viewTransform->FixedLayerMarginRight();
aFixedLayerMargins.bottom = viewTransform->FixedLayerMarginBottom();
aFixedLayerMargins.left = viewTransform->FixedLayerMarginLeft();
aOffset.x = viewTransform->OffsetX();
aOffset.y = viewTransform->OffsetY();
}
/* Implementation file */

View File

@ -252,10 +252,10 @@ public:
void SetPageRect(const CSSRect& aCssPageRect);
void SyncViewportInfo(const LayerIntRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
bool aLayersUpdated, ParentLayerPoint& aScrollOffset, CSSToParentLayerScale& aScale,
LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset);
LayerMargin& aFixedLayerMargins);
void SyncFrameMetrics(const ParentLayerPoint& aScrollOffset, float aZoom, const CSSRect& aCssPageRect,
bool aLayersUpdated, const CSSRect& aDisplayPort, const CSSToLayerScale& aDisplayResolution,
bool aIsFirstPaint, LayerMargin& aFixedLayerMargins, ScreenPoint& aOffset);
bool aIsFirstPaint, LayerMargin& aFixedLayerMargins);
void AddPluginView(jobject view, const LayoutDeviceRect& rect, bool isFullScreen);

View File

@ -1302,32 +1302,6 @@ auto ViewTransform::FixedLayerMarginTop(float a0) const -> void
return mozilla::jni::Field<FixedLayerMarginTop_t>::Set(this, nullptr, a0);
}
constexpr char ViewTransform::OffsetX_t::name[];
constexpr char ViewTransform::OffsetX_t::signature[];
auto ViewTransform::OffsetX() const -> float
{
return mozilla::jni::Field<OffsetX_t>::Get(this, nullptr);
}
auto ViewTransform::OffsetX(float a0) const -> void
{
return mozilla::jni::Field<OffsetX_t>::Set(this, nullptr, a0);
}
constexpr char ViewTransform::OffsetY_t::name[];
constexpr char ViewTransform::OffsetY_t::signature[];
auto ViewTransform::OffsetY() const -> float
{
return mozilla::jni::Field<OffsetY_t>::Get(this, nullptr);
}
auto ViewTransform::OffsetY(float a0) const -> void
{
return mozilla::jni::Field<OffsetY_t>::Set(this, nullptr, a0);
}
constexpr char ViewTransform::Scale_t::name[];
constexpr char ViewTransform::Scale_t::signature[];

View File

@ -3081,44 +3081,6 @@ public:
auto FixedLayerMarginTop(float) const -> void;
public:
struct OffsetX_t {
typedef ViewTransform Owner;
typedef float ReturnType;
typedef float SetterType;
typedef mozilla::jni::Args<> Args;
static constexpr char name[] = "offsetX";
static constexpr char signature[] =
"F";
static const bool isStatic = false;
static const bool isMultithreaded = true;
static const mozilla::jni::ExceptionMode exceptionMode =
mozilla::jni::ExceptionMode::ABORT;
};
auto OffsetX() const -> float;
auto OffsetX(float) const -> void;
public:
struct OffsetY_t {
typedef ViewTransform Owner;
typedef float ReturnType;
typedef float SetterType;
typedef mozilla::jni::Args<> Args;
static constexpr char name[] = "offsetY";
static constexpr char signature[] =
"F";
static const bool isStatic = false;
static const bool isMultithreaded = true;
static const mozilla::jni::ExceptionMode exceptionMode =
mozilla::jni::ExceptionMode::ABORT;
};
auto OffsetY() const -> float;
auto OffsetY(float) const -> void;
public:
struct Scale_t {
typedef ViewTransform Owner;