예제 #1
0
파일: SkView.cpp 프로젝트: BBKeeper/Skia
void SkView::inval(SkRect* rect) {
	SkView*	view = this;
    SkRect storage;

	for (;;) {
        if (!view->isVisible()) {
            return;
        }
        if (view->isClipToBounds()) {
            SkRect bounds;
            view->getLocalBounds(&bounds);
            if (rect && !bounds.intersect(*rect)) {
                return;
            }
            storage = bounds;
            rect = &storage;
        }
        if (view->handleInval(rect)) {
            return;
        }

		SkView* parent = view->fParent;
        if (parent == NULL) {
            return;
        }

        if (rect) {
            rect->offset(view->fLoc.fX, view->fLoc.fY);
        }
        view = parent;
	}
}
예제 #2
0
void SkView::inval(SkRect* rect)
{
	if (!this->isVisible())
		return;

	SkRect	bounds;

	this->getLocalBounds(&bounds);
	if (rect && !bounds.intersect(*rect))
		return;

	rect = &bounds;
	SkView*	view = this;

	for (;;)
	{
		if (view->handleInval(bounds))
			break;

		SkRect	parentR;
		SkView* parent = view->fParent;

		if (parent == NULL || !parent->isVisible())
			break;

		bounds.offset(view->fLoc.fX, view->fLoc.fY);
		parent->getLocalBounds(&parentR);
		if (!bounds.intersect(parentR))
			return;

		view = parent;
	}
}