am 2e7fbd97: Merge "Preapre region tracking in layers" into honeycomb
* commit '2e7fbd97e6f3682b20631d4f5262321dba6e2c6f': Preapre region tracking in layers
This commit is contained in:
@@ -697,13 +697,7 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top,
|
|||||||
if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) {
|
if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) {
|
||||||
Rect bounds(left, top, right, bottom);
|
Rect bounds(left, top, right, bottom);
|
||||||
transform.mapRect(bounds);
|
transform.mapRect(bounds);
|
||||||
if (bounds.intersect(*mSnapshot->clipRect)) {
|
dirtyLayerUnchecked(bounds, mSnapshot->region);
|
||||||
bounds.snapToPixelBoundaries();
|
|
||||||
android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom);
|
|
||||||
if (!dirty.isEmpty()) {
|
|
||||||
mSnapshot->region->orSelf(dirty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -713,12 +707,18 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top,
|
|||||||
#if RENDER_LAYERS_AS_REGIONS
|
#if RENDER_LAYERS_AS_REGIONS
|
||||||
if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) {
|
if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) {
|
||||||
Rect bounds(left, top, right, bottom);
|
Rect bounds(left, top, right, bottom);
|
||||||
|
dirtyLayerUnchecked(bounds, mSnapshot->region);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenGLRenderer::dirtyLayerUnchecked(Rect& bounds, Region* region) {
|
||||||
|
#if RENDER_LAYERS_AS_REGIONS
|
||||||
if (bounds.intersect(*mSnapshot->clipRect)) {
|
if (bounds.intersect(*mSnapshot->clipRect)) {
|
||||||
bounds.snapToPixelBoundaries();
|
bounds.snapToPixelBoundaries();
|
||||||
android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom);
|
android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom);
|
||||||
if (!dirty.isEmpty()) {
|
if (!dirty.isEmpty()) {
|
||||||
mSnapshot->region->orSelf(dirty);
|
region->orSelf(dirty);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -145,6 +145,8 @@ protected:
|
|||||||
virtual void dirtyLayer(const float left, const float top,
|
virtual void dirtyLayer(const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
|
void dirtyLayerUnchecked(Rect& bounds, Region* region);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Saves the current state of the renderer as a new snapshot.
|
* Saves the current state of the renderer as a new snapshot.
|
||||||
|
|||||||
Reference in New Issue
Block a user