зеркало из https://github.com/mozilla/pjs.git
bug 721216 - Bitmap compression on main thread causes the tab strip to take a long time to appear r=pcwalton
This commit is contained in:
Родитель
03c3867afb
Коммит
b07b76a8d6
|
@ -594,11 +594,10 @@ abstract public class GeckoApp
|
|||
}
|
||||
}
|
||||
|
||||
void getAndProcessThumbnailForTab(Tab tab) {
|
||||
Bitmap bitmap = null;
|
||||
if (Tabs.getInstance().isSelectedTab(tab))
|
||||
bitmap = mSoftwareLayerClient.getBitmap();
|
||||
|
||||
void getAndProcessThumbnailForTab(final Tab tab) {
|
||||
final Bitmap bitmap = Tabs.getInstance().isSelectedTab(tab) ?
|
||||
mSoftwareLayerClient.getBitmap() : null;
|
||||
|
||||
if (bitmap != null) {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 0, bos);
|
||||
|
|
|
@ -288,8 +288,12 @@ public class Tabs implements GeckoEventListener {
|
|||
}
|
||||
|
||||
public void refreshThumbnails() {
|
||||
Iterator<Tab> iterator = tabs.values().iterator();
|
||||
while (iterator.hasNext())
|
||||
GeckoApp.mAppContext.getAndProcessThumbnailForTab(iterator.next());
|
||||
GeckoAppShell.getHandler().post(new Runnable() {
|
||||
public void run() {
|
||||
Iterator<Tab> iterator = tabs.values().iterator();
|
||||
while (iterator.hasNext())
|
||||
GeckoApp.mAppContext.getAndProcessThumbnailForTab(iterator.next());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,8 +91,8 @@ public class TabsTray extends Activity implements GeckoApp.OnTabsChangedListener
|
|||
}
|
||||
});
|
||||
|
||||
Tabs.getInstance().refreshThumbnails();
|
||||
GeckoApp.registerOnTabsChangedListener(this);
|
||||
Tabs.getInstance().refreshThumbnails();
|
||||
onTabsChanged(null);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче