зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1147279
- Get correct translation when layer optimize away. r=roc
--HG-- extra : rebase_source : e9e56fe3a0f1d8a88de1e0b40151ed2e452e4ff9
This commit is contained in:
Родитель
bf8f5ea54f
Коммит
8b1d489941
|
@ -213,6 +213,21 @@ struct EventRegions {
|
|||
mDispatchToContentHitRegion.Sub(aMinuend.mDispatchToContentHitRegion, aSubtrahend);
|
||||
}
|
||||
|
||||
void ApplyTranslationAndScale(float aXTrans, float aYTrans, float aXScale, float aYScale)
|
||||
{
|
||||
mHitRegion.ScaleRoundOut(aXScale, aYScale);
|
||||
mDispatchToContentHitRegion.ScaleRoundOut(aXScale, aYScale);
|
||||
mNoActionRegion.ScaleRoundOut(aXScale, aYScale);
|
||||
mHorizontalPanRegion.ScaleRoundOut(aXScale, aYScale);
|
||||
mVerticalPanRegion.ScaleRoundOut(aXScale, aYScale);
|
||||
|
||||
mHitRegion.MoveBy(aXTrans, aYTrans);
|
||||
mDispatchToContentHitRegion.MoveBy(aXTrans, aYTrans);
|
||||
mNoActionRegion.MoveBy(aXTrans, aYTrans);
|
||||
mHorizontalPanRegion.MoveBy(aXTrans, aYTrans);
|
||||
mVerticalPanRegion.MoveBy(aXTrans, aYTrans);
|
||||
}
|
||||
|
||||
void Transform(const gfx3DMatrix& aTransform)
|
||||
{
|
||||
mHitRegion.Transform(aTransform);
|
||||
|
|
|
@ -565,6 +565,11 @@ uint64_t nsRegion::Area () const
|
|||
|
||||
nsRegion& nsRegion::ScaleRoundOut (float aXScale, float aYScale)
|
||||
{
|
||||
if (mozilla::gfx::FuzzyEqual(aXScale, 1.0f) &&
|
||||
mozilla::gfx::FuzzyEqual(aYScale, 1.0f)) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
int n;
|
||||
pixman_box32_t *boxes = pixman_region32_rectangles(&mImpl, &n);
|
||||
for (int i=0; i<n; i++) {
|
||||
|
|
|
@ -3034,12 +3034,9 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB
|
|||
ScaleRegionToOutsidePixels(data->mDispatchToContentHitRegion));
|
||||
regions.mHitRegion.OrWith(maybeHitRegion);
|
||||
|
||||
nsIntPoint translation = -GetTranslationForPaintedLayer(data->mLayer);
|
||||
regions.mHitRegion.MoveBy(translation);
|
||||
regions.mDispatchToContentHitRegion.MoveBy(translation);
|
||||
regions.mNoActionRegion.MoveBy(translation);
|
||||
regions.mHorizontalPanRegion.MoveBy(translation);
|
||||
regions.mVerticalPanRegion.MoveBy(translation);
|
||||
Matrix mat = layer->GetBaseTransform().As2D();
|
||||
mat.Invert();
|
||||
regions.ApplyTranslationAndScale(mat._31, mat._32, mat._11, mat._22);
|
||||
|
||||
layer->SetEventRegions(regions);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче