зеркало из https://github.com/mozilla/gecko-dev.git
Bug 957276 - Fix YFlipped buffer's source crop r=sushil
This commit is contained in:
Родитель
8b7a332a94
Коммит
f640a7757e
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче