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

Commit ba649741 authored by Michael Jurka's avatar Michael Jurka
Browse files

Removing setChildrenLayersEnabled

Change-Id: I88d8228eadb59160648f2c4e131fcd85945f2109
parent 041c3668
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -12363,9 +12363,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                canvas.setViewport(width, height);
                // The dirty rect should always be null for a display list
                canvas.onPreDraw(null);
                int layerType = (
                        !(mParent instanceof ViewGroup) || ((ViewGroup)mParent).mDrawLayers) ?
                        getLayerType() : LAYER_TYPE_NONE;
                int layerType = getLayerType();
                if (!isLayer && layerType != LAYER_TYPE_NONE) {
                    if (layerType == LAYER_TYPE_HARDWARE) {
                        final HardwareLayer layer = getHardwareLayer();
@@ -13072,7 +13070,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        boolean scalingRequired = false;
        boolean caching;
        int layerType = parent.mDrawLayers ? getLayerType() : LAYER_TYPE_NONE;
        int layerType = getLayerType();
        final boolean hardwareAccelerated = canvas.isHardwareAccelerated();
        if ((flags & ViewGroup.FLAG_CHILDREN_DRAWN_WITH_CACHE) != 0 ||
+0 −43
Original line number Diff line number Diff line
@@ -404,10 +404,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
    // views during a transition when they otherwise would have become gone/invisible
    private ArrayList<View> mVisibilityChangingChildren;

    // Indicates whether this container will use its children layers to draw
    @ViewDebug.ExportedProperty(category = "drawing")
    boolean mDrawLayers = true;

    // Indicates how many of this container's child subtrees contain transient state
    @ViewDebug.ExportedProperty(category = "layout")
    private int mChildCountWithTransientState = 0;
@@ -2929,45 +2925,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        return child.draw(canvas, this, drawingTime);
    }

    /**
     * 
     * @param enabled True if children should be drawn with layers, false otherwise.
     * 
     * @hide
     */
    public void setChildrenLayersEnabled(boolean enabled) {
        if (enabled != mDrawLayers) {
            mDrawLayers = enabled;
            invalidate(true);

            boolean flushLayers = !enabled;
            AttachInfo info = mAttachInfo;
            if (info != null && info.mHardwareRenderer != null &&
                    info.mHardwareRenderer.isEnabled()) {
                if (!info.mHardwareRenderer.validate()) {
                    flushLayers = false;
                }
            } else {
                flushLayers = false;
            }

            // We need to invalidate any child with a layer. For instance,
            // if a child is backed by a hardware layer and we disable layers
            // the child is marked as not dirty (flags cleared the last time
            // the child was drawn inside its layer.) However, that child might
            // never have created its own display list or have an obsolete
            // display list. By invalidating the child we ensure the display
            // list is in sync with the content of the hardware layer.
            for (int i = 0; i < mChildrenCount; i++) {
                View child = mChildren[i];
                if (child.mLayerType != LAYER_TYPE_NONE) {
                    if (flushLayers) child.flushLayer();
                    child.invalidate(true);
                }
            }
        }
    }

    /**
     * By default, children are clipped to their bounds before drawing. This
     * allows view groups to override this behavior for animations, etc.
+0 −9
Original line number Diff line number Diff line
@@ -276,15 +276,6 @@
            </intent-filter>
        </activity>

        <activity
                android:name="ViewLayersActivity6"
                android:label="_ViewLayers6">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
                android:name="AlphaLayersActivity"
                android:label="_αLayers">
+14 −2
Original line number Diff line number Diff line
@@ -26,17 +26,29 @@
        android:layout_weight="1">

        <Button
            android:onClick="setLayerEnabled"
            android:onClick="enableLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Enable layer" />

        <Button
            android:onClick="setLayerDisabled"
            android:onClick="disableLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Disable layer" />

        <Button
            android:onClick="shrinkLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Shrink layer" />

        <Button
            android:onClick="growLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Grow layer" />
        
    </LinearLayout>

    <ListView
+0 −60
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="1">

        <Button
            android:onClick="enableLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Enable layer" />

        <Button
            android:onClick="disableLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Disable layer" />

        <Button
            android:onClick="shrinkLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Shrink layer" />

        <Button
            android:onClick="growLayer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Grow layer" />
        
    </LinearLayout>

    <ListView
        android:id="@+id/list1"
        android:layout_width="0dip"
        android:layout_height="match_parent"
        android:layout_weight="1" />

</LinearLayout>
Loading