Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Avoid superfluous resizes with Layers (#1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and keianhzo committed Aug 1, 2019
1 parent 6825e9a commit 6c48e63
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,7 @@ void dispatchCreateWidgetLayer(final int aHandle, final Surface aSurface, final
View view = (View) widget;
// Add widget to a virtual display for invalidation
if (aSurface != null && view.getParent() == null) {
float scale = widget.getPlacement().textureScale;
mWidgetContainer.addView(view, new FrameLayout.LayoutParams((int) Math.ceil(aWidth / scale), (int) Math.ceil(aHeight / scale)));
mWidgetContainer.addView(view, new FrameLayout.LayoutParams(widget.getPlacement().viewWidth(), widget.getPlacement().viewHeight()));
} else if (aSurface == null && view.getParent() != null) {
mWidgetContainer.removeView(view);
}
Expand Down

0 comments on commit 6c48e63

Please sign in to comment.