mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1299922 - Keep surface covered until it has been painted when switching tabs in Fennec r=jchen
This commit is contained in:
parent
8adc72b766
commit
6e384a2633
@ -259,7 +259,7 @@ public class Tabs implements GeckoEventListener {
|
||||
notifyListeners(tab, TabEvents.SELECTED);
|
||||
|
||||
if (mLayerView != null) {
|
||||
mLayerView.setClearColor(tab.isPrivate() ? mPrivateClearColor : Color.WHITE);
|
||||
mLayerView.setClearColor(getTabColor(tab));
|
||||
}
|
||||
|
||||
if (oldTab != null) {
|
||||
@ -672,6 +672,10 @@ public class Tabs implements GeckoEventListener {
|
||||
// are also selected/unselected, so it would be redundant to also listen
|
||||
// for ADDED/CLOSED events.
|
||||
case SELECTED:
|
||||
if (mLayerView != null) {
|
||||
mLayerView.setSurfaceBackgroundColor(getTabColor(tab));
|
||||
mLayerView.setPaintState(LayerView.PAINT_START);
|
||||
}
|
||||
queuePersistAllTabs();
|
||||
case UNSELECTED:
|
||||
tab.onChange();
|
||||
@ -983,4 +987,12 @@ public class Tabs implements GeckoEventListener {
|
||||
public static int getNextTabId() {
|
||||
return sTabId.getAndIncrement();
|
||||
}
|
||||
|
||||
private int getTabColor(Tab tab) {
|
||||
if (tab != null) {
|
||||
return tab.isPrivate() ? mPrivateClearColor : Color.WHITE;
|
||||
}
|
||||
|
||||
return Color.WHITE;
|
||||
}
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ public class LayerView extends ScrollView implements Tabs.OnTabsChangedListener
|
||||
return mLayerClient.getMatrixForLayerRectToViewRect();
|
||||
}
|
||||
|
||||
void setSurfaceBackgroundColor(int newColor) {
|
||||
public void setSurfaceBackgroundColor(int newColor) {
|
||||
if (mSurfaceView != null) {
|
||||
mSurfaceView.setBackgroundColor(newColor);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user