зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c783463c77
Коммит
2081db70d4
|
@ -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 = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче