Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f653aa7e authored by Xavier Ducrohet's avatar Xavier Ducrohet Committed by Android (Google) Code Review
Browse files

Merge "LayoutLib: add support for layout_only render."

parents defba0ca 10df650f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge {
                Capability.UNBOUND_RENDERING,
                Capability.CUSTOM_BACKGROUND_COLOR,
                Capability.RENDER,
                Capability.LAYOUT_ONLY,
                Capability.EMBEDDED_LAYOUT,
                Capability.VIEW_MANIPULATION,
                Capability.PLAY_ANIMATION,
+48 −42
Original line number Diff line number Diff line
@@ -421,6 +421,11 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
            // now do the layout.
            mViewRoot.layout(0, 0, mMeasuredScreenWidth, mMeasuredScreenHeight);

            if (params.isLayoutOnly()) {
                // delete the canvas and image to reset them on the next full rendering
                mImage = null;
                mCanvas = null;
            } else {
                mViewRoot.mAttachInfo.mTreeObserver.dispatchOnPreDraw();

                // draw the views
@@ -471,6 +476,7 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
                }

                mViewRoot.draw(mCanvas);
            }

            mViewInfoList = startVisitingViews(mViewRoot, 0);