Example usage for android.graphics Region op

List of usage examples for android.graphics Region op

Introduction

In this page you can find the example usage for android.graphics Region op.

Prototype

public boolean op(int left, int top, int right, int bottom, Op op) 

Source Link

Document

Perform the specified Op on this region and the specified rect.

Usage

From source file:Main.java

/**
 * Helper for overriding {@link ViewGroup#gatherTransparentRegion} for views that are fully
 * opaque and have children extending beyond their bounds. If the transparent region
 * optimization is turned on (which is the case whenever the view hierarchy contains a
 * SurfaceView somewhere), the children might otherwise confuse the SurfaceFlinger.
 *///  www . j  ava  2s. c om
public static void gatherTransparentRegionsForOpaqueView(View view, Region region) {
    view.getLocationInWindow(sLocationTmp);
    region.op(sLocationTmp[0], sLocationTmp[1], sLocationTmp[0] + view.getRight() - view.getLeft(),
            sLocationTmp[1] + view.getBottom() - view.getTop(), Region.Op.DIFFERENCE);
}