Bug 1259529 - Clean up the APZ minimap rendering code a bit. No functional changes. r=BenWa

MozReview-Commit-ID: avf1rlxSpj
This commit is contained in:
Kartikaya Gupta 2016-03-24 16:06:08 -04:00
Родитель 6eae4e772d
Коммит 8314c3f23b
1 изменённых файлов: 6 добавлений и 26 удалений

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

@ -527,34 +527,15 @@ RenderMinimap(ContainerT* aContainer, LayerManagerComposite* aManager,
Matrix4x4 transform = Matrix4x4::Scaling(scaleFactor, scaleFactor, 1);
transform.PostTranslate(horizontalPadding + compositionBounds.x, verticalPadding + compositionBounds.y, 0);
Rect clipRect = aContainer->GetEffectiveTransform().TransformBounds(
transform.TransformBounds(scrollRect.ToUnknownRect()));
Rect transformedScrollRect = transform.TransformBounds(scrollRect.ToUnknownRect());
Rect clipRect = aContainer->GetEffectiveTransform().TransformBounds(transformedScrollRect);
clipRect.width++;
clipRect.height++;
Rect r;
r = transform.TransformBounds(scrollRect.ToUnknownRect());
compositor->FillRect(r, backgroundColor, clipRect, aContainer->GetEffectiveTransform());
/* Disabled because on long pages SlowDrawRect becomes a bottleneck.
int tileW = gfxPrefs::LayersTileWidth();
int tileH = gfxPrefs::LayersTileHeight();
for (int x = scrollRect.x; x < scrollRect.XMost(); x += tileW) {
for (int y = scrollRect.y; y < scrollRect.YMost(); y += tileH) {
LayerRect tileRect = LayerRect(x - x % tileW, y - y % tileH, tileW, tileH);
r = transform.TransformBounds(tileRect.ToUnknownRect());
if (tileRect.Intersects(dp)) {
compositor->FillRect(r, tileActiveColor, clipRect, aContainer->GetEffectiveTransform());
}
compositor->SlowDrawRect(r, tileBorderColor, clipRect, aContainer->GetEffectiveTransform());
}
}
*/
// Render the scrollable area.
r = transform.TransformBounds(scrollRect.ToUnknownRect());
compositor->SlowDrawRect(r, pageBorderColor, clipRect, aContainer->GetEffectiveTransform());
compositor->FillRect(transformedScrollRect, backgroundColor, clipRect, aContainer->GetEffectiveTransform());
compositor->SlowDrawRect(transformedScrollRect, pageBorderColor, clipRect, aContainer->GetEffectiveTransform());
// If enabled, render information about visibility.
if (gfxPrefs::APZMinimapVisibilityEnabled()) {
@ -585,9 +566,8 @@ RenderMinimap(ContainerT* aContainer, LayerManagerComposite* aManager,
}
// Render the displayport.
r = transform.TransformBounds(dp.ToUnknownRect());
Rect r = transform.TransformBounds(dp.ToUnknownRect());
compositor->FillRect(r, tileActiveColor, clipRect, aContainer->GetEffectiveTransform());
r = transform.TransformBounds(dp.ToUnknownRect());
compositor->SlowDrawRect(r, displayPortColor, clipRect, aContainer->GetEffectiveTransform());
// Render the viewport.