Bug 957276 - Fix YFlipped buffer's source crop r=sushil

This commit is contained in:
Sotaro Ikeda 2014-02-22 04:56:02 -08:00
parent 1e421988da
commit 68d184454e
3 changed files with 7 additions and 0 deletions

View File

@ -287,6 +287,7 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
transform * aGLWorldTransform,
clip,
bufferRect,
state.YFlipped(),
&(sourceCrop),
&(hwcLayer.displayFrame)))
{

View File

@ -38,6 +38,7 @@ namespace mozilla {
/* static */ bool
HwcUtils::PrepareLayerRects(nsIntRect aVisible, const gfxMatrix& aTransform,
nsIntRect aClip, nsIntRect aBufferRect,
bool aYFlipped,
hwc_rect_t* aSourceCrop, hwc_rect_t* aVisibleRegionScreen) {
gfxRect visibleRect(aVisible);
@ -70,6 +71,9 @@ HwcUtils::PrepareLayerRects(nsIntRect aVisible, const gfxMatrix& aTransform,
// Map from layer space to buffer space
crop -= aBufferRect.TopLeft();
if (aYFlipped) {
crop.y = aBufferRect.height - (crop.y + crop.height);
}
aSourceCrop->left = crop.x;
aSourceCrop->top = crop.y;

View File

@ -100,6 +100,7 @@ static bool PrepareVisibleRegion(const nsIntRegion& aVisible,
* The origin is the top-left corner of the screen
* @param aBufferRect Input. The layer's buffer bounds
* The origin is the top-left corner of the layer
* @param aYFlipped Input. true if the buffer is rendered as Y flipped
* @param aSurceCrop Output. Area of the source to consider,
* the origin is the top-left corner of the buffer
* @param aVisibleRegionScreen Output. Visible region in screen space.
@ -109,6 +110,7 @@ static bool PrepareVisibleRegion(const nsIntRegion& aVisible,
*/
static bool PrepareLayerRects(nsIntRect aVisible, const gfxMatrix& aTransform,
nsIntRect aClip, nsIntRect aBufferRect,
bool aYFlipped,
hwc_rect_t* aSourceCrop,
hwc_rect_t* aVisibleRegionScreen);