Bug 993004 - Fix the clipping of tiles when the screen is rotated. r=botond
This commit is contained in:
@@ -107,18 +107,33 @@ Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
|
||||
gfx::Rect
|
||||
Compositor::ClipRectInLayersCoordinates(gfx::Rect aClip) const {
|
||||
gfx::Rect result;
|
||||
aClip = aClip + GetCurrentRenderTarget()->GetOrigin();
|
||||
gfx::IntSize destSize = GetWidgetSize();
|
||||
|
||||
switch (mScreenRotation) {
|
||||
case ROTATION_90:
|
||||
case ROTATION_270:
|
||||
result = gfx::Rect(aClip.y, aClip.x, aClip.height, aClip.width);
|
||||
break;
|
||||
case ROTATION_0:
|
||||
case ROTATION_180:
|
||||
default:
|
||||
result = aClip;
|
||||
break;
|
||||
case ROTATION_90:
|
||||
result = gfx::Rect(aClip.y,
|
||||
destSize.width - aClip.x - aClip.width,
|
||||
aClip.height, aClip.width);
|
||||
break;
|
||||
case ROTATION_270:
|
||||
result = gfx::Rect(destSize.height - aClip.y - aClip.height,
|
||||
aClip.x,
|
||||
aClip.height, aClip.width);
|
||||
break;
|
||||
case ROTATION_180:
|
||||
result = gfx::Rect(destSize.width - aClip.x - aClip.width,
|
||||
destSize.height - aClip.y - aClip.height,
|
||||
aClip.width, aClip.height);
|
||||
break;
|
||||
// ScreenRotation has a sentinel value, need to catch it in the switch
|
||||
// statement otherwise the build fails (-WError)
|
||||
default: {}
|
||||
}
|
||||
return result + GetCurrentRenderTarget()->GetOrigin();
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user