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
Родитель 8b7a332a94
Коммит f640a7757e
3 изменённых файлов: 7 добавлений и 0 удалений

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

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

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

@ -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;

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

@ -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);