Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
| index d1d7414cc58610c39827a50d30950593477a6abb..dd31fcf121791e97e8e6aaed97d345631fac0e53 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java |
| @@ -150,6 +150,9 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
| // The next id to show when the layout is hidden, or TabBase#INVALID_TAB_ID if no change. |
| private int mNextTabId = Tab.INVALID_TAB_ID; |
| + // The last used ResourceManager. |
| + private ResourceManager mResourceManager; |
| + |
| /** |
| * The {@link Layout} is not usable until sizeChanged is called. |
| * This is convenient this way so we can pre-create the layout before the host is fully defined. |
| @@ -189,6 +192,7 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
| * Cleans up any internal state. This object should not be used after this call. |
| */ |
| public void destroy() { |
| + mResourceManager = null; |
| } |
| /** |
| @@ -501,6 +505,7 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
| mNextTabId = Tab.INVALID_TAB_ID; |
| } |
| mUpdateHost.doneHiding(); |
| + if (mResourceManager != null) mResourceManager.clearTintedResourceCache(); |
| } |
| /** |
| @@ -1173,6 +1178,9 @@ public abstract class Layout implements TabContentManager.ThumbnailChangeListene |
| updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager, |
| resourceManager, fullscreenManager); |
| + // Cache the current ResourceManager. |
| + mResourceManager = resourceManager; |
|
David Trainor- moved to gerrit
2016/08/30 19:27:32
Would it be cleaner to add a method to the host to
mdjones
2016/08/30 21:52:16
Turns out mRenderHost has one.
|
| + |
| float offsetPx = fullscreenManager != null ? fullscreenManager.getControlOffset() : 0.f; |
| float dpToPx = getContext().getResources().getDisplayMetrics().density; |
| float offsetDp = offsetPx / dpToPx; |