/** Gets the bounds of the given descendant that relative to this view. */ public boolean getBoundsOf(GLView descendant, Rect out) { int xoffset = 0; int yoffset = 0; GLView view = descendant; while (view != this) { if (view == null) return false; Rect bounds = view.mBounds; xoffset += bounds.left; yoffset += bounds.top; view = view.mParent; } out.set(xoffset, yoffset, xoffset + descendant.getWidth(), yoffset + descendant.getHeight()); return true; }