mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
24036897e7
commit
e94153995b
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user