mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Cache the checkberboard color so that we don't redo a bunch of work uselessly
This commit is contained in:
parent
d7e856edfc
commit
64f4f0f8e3
@ -86,6 +86,8 @@ public abstract class GeckoLayerClient extends LayerClient implements GeckoEvent
|
||||
// inside a transaction, so no synchronization is needed.
|
||||
private boolean mUpdateViewportOnEndDraw;
|
||||
|
||||
private String mLastCheckerboardColor;
|
||||
|
||||
private static Pattern sColorPattern;
|
||||
|
||||
/* Used by robocop for testing purposes */
|
||||
@ -145,7 +147,8 @@ public abstract class GeckoLayerClient extends LayerClient implements GeckoEvent
|
||||
|
||||
// Update the background color, if it's present.
|
||||
String backgroundColorString = viewportObject.optString("backgroundColor");
|
||||
if (backgroundColorString != null) {
|
||||
if (backgroundColorString != null && !backgroundColorString.equals(mLastCheckerboardColor)) {
|
||||
mLastCheckerboardColor = backgroundColorString;
|
||||
LayerController controller = getLayerController();
|
||||
controller.setCheckerboardColor(parseColorFromGecko(backgroundColorString));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user