mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Update shadow tiling when page size changes
Without this patch, the shadows for the page get drawn with stale page heights because the vertex buffers are not updated when the page height changes. With the previous patch applied, this results in shadows extending down past the page when they shouldn't.
This commit is contained in:
parent
4fefbf7dd5
commit
12e8924064
@ -182,6 +182,7 @@ public class LayerController implements ScaleGestureDetector.OnScaleGestureListe
|
||||
|
||||
public void setPageSize(IntSize size) {
|
||||
mPageSize = size.scale(getZoomFactor());
|
||||
mView.notifyRendererOfPageSizeChange();
|
||||
}
|
||||
|
||||
public boolean post(Runnable action) { return mView.post(action); }
|
||||
|
@ -142,6 +142,10 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
|
||||
gl.glDisable(GL10.GL_BLEND);
|
||||
}
|
||||
|
||||
public void pageSizeChanged() {
|
||||
mShadowLayer.recreateVertexBuffers();
|
||||
}
|
||||
|
||||
private void setupPageTransform(GL10 gl) {
|
||||
LayerController controller = mView.getController();
|
||||
IntRect visibleRect = controller.getVisibleRect();
|
||||
|
@ -86,6 +86,10 @@ public class LayerView extends GLSurfaceView {
|
||||
public LayerController getController() { return mController; }
|
||||
public void geometryChanged() { /* TODO: Schedule a redraw. */ }
|
||||
|
||||
public void notifyRendererOfPageSizeChange() {
|
||||
mRenderer.pageSizeChanged();
|
||||
}
|
||||
|
||||
/** The LayerRenderer calls this to indicate that the window has changed size. */
|
||||
public void setScreenSize(int width, int height) {
|
||||
mController.setScreenSize(width, height);
|
||||
|
@ -101,7 +101,7 @@ public class NinePatchTileLayer extends TileLayer {
|
||||
recreateVertexBuffers();
|
||||
}
|
||||
|
||||
private void recreateVertexBuffers() {
|
||||
public void recreateVertexBuffers() {
|
||||
IntSize pageSize = mLayerController.getPageSize();
|
||||
|
||||
float[] sideVertices = {
|
||||
|
Loading…
Reference in New Issue
Block a user