am b0204d0a: am c2b91a61: Merge "Modify the GL renderer\'s functor to pass the clip to WebView" into honeycomb-mr1
* commit 'b0204d0a271dafdf5be216f30c001929bdd831c0': Modify the GL renderer's functor to pass the clip to WebView
This commit is contained in:
@@ -25,8 +25,7 @@ class Functor {
|
|||||||
public:
|
public:
|
||||||
Functor() {}
|
Functor() {}
|
||||||
virtual ~Functor() {}
|
virtual ~Functor() {}
|
||||||
virtual status_t operator ()() { return true; }
|
virtual status_t operator ()(int what, void* data) { return NO_ERROR; }
|
||||||
virtual status_t operator ()(float* data, uint32_t len) { return true; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace android
|
}; // namespace android
|
||||||
|
|||||||
@@ -216,21 +216,41 @@ bool OpenGLRenderer::callDrawGLFunction(Functor *functor, Rect& dirty) {
|
|||||||
setScissorFromClip();
|
setScissorFromClip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rect clip(*mSnapshot->clipRect);
|
||||||
|
clip.snapToPixelBoundaries();
|
||||||
|
|
||||||
#if RENDER_LAYERS_AS_REGIONS
|
#if RENDER_LAYERS_AS_REGIONS
|
||||||
// Since we don't know what the functor will draw, let's dirty
|
// Since we don't know what the functor will draw, let's dirty
|
||||||
// tne entire clip region
|
// tne entire clip region
|
||||||
if (hasLayer()) {
|
if (hasLayer()) {
|
||||||
Rect clip(*mSnapshot->clipRect);
|
|
||||||
clip.snapToPixelBoundaries();
|
|
||||||
dirtyLayerUnchecked(clip, getRegion());
|
dirtyLayerUnchecked(clip, getRegion());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float bounds[4];
|
struct {
|
||||||
status_t result = (*functor)(&bounds[0], 4);
|
// Input: current clip rect
|
||||||
|
int clipLeft;
|
||||||
|
int clipTop;
|
||||||
|
int clipRight;
|
||||||
|
int clipBottom;
|
||||||
|
|
||||||
|
// Output: dirty region to redraw
|
||||||
|
float dirtyLeft;
|
||||||
|
float dirtyTop;
|
||||||
|
float dirtyRight;
|
||||||
|
float dirtyBottom;
|
||||||
|
} constraints;
|
||||||
|
|
||||||
|
constraints.clipLeft = clip.left;
|
||||||
|
constraints.clipTop = clip.top;
|
||||||
|
constraints.clipRight = clip.right;
|
||||||
|
constraints.clipBottom = clip.bottom;
|
||||||
|
|
||||||
|
status_t result = (*functor)(0, &constraints);
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
Rect localDirty(bounds[0], bounds[1], bounds[2], bounds[3]);
|
Rect localDirty(constraints.dirtyLeft, constraints.dirtyTop,
|
||||||
|
constraints.dirtyRight, constraints.dirtyBottom);
|
||||||
dirty.unionWith(localDirty);
|
dirty.unionWith(localDirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user