From 4825cbfd9d1ffe09f93172893e73819ab9347546 Mon Sep 17 00:00:00 2001 From: "powei@chromium.org" Date: Fri, 13 Jun 2014 07:15:45 +0000 Subject: android: content::UIResourceProvider and content::UIResourceClientAndroid We abstract out the allocation of UI resources into the UIResourceProvider. We add a client class that allows for callback from the provider when resources are invalidated (due to change in LayerTreeHost). android= https://chrome-internal-review.googlesource.com/#/c/164986 BUG= TBR=jam@chromium.org Review URL: https://codereview.chromium.org/287593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276955 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/renderer_host/compositor_impl_android.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'content/browser/renderer_host/compositor_impl_android.h') diff --git a/content/browser/renderer_host/compositor_impl_android.h b/content/browser/renderer_host/compositor_impl_android.h index 360df36..61743af 100644 --- a/content/browser/renderer_host/compositor_impl_android.h +++ b/content/browser/renderer_host/compositor_impl_android.h @@ -14,6 +14,7 @@ #include "cc/resources/ui_resource_client.h" #include "cc/trees/layer_tree_host_client.h" #include "cc/trees/layer_tree_host_single_thread_client.h" +#include "content/browser/android/ui_resource_provider_impl.h" #include "content/browser/renderer_host/image_transport_factory_android.h" #include "content/common/content_export.h" #include "content/public/browser/android/compositor.h" @@ -32,6 +33,7 @@ class LayerTreeHost; namespace content { class CompositorClient; class GraphicsContext; +class UIResourceProvider; // ----------------------------------------------------------------------------- // Browser-side compositor that manages a tree of content and UI layers. @@ -65,13 +67,7 @@ class CONTENT_EXPORT CompositorImpl virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; virtual void SetHasTransparentBackground(bool flag) OVERRIDE; virtual void SetNeedsComposite() OVERRIDE; - virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap, - bool is_transient) OVERRIDE; - virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size, - void* pixels, - bool is_transient) - OVERRIDE; - virtual void DeleteUIResource(cc::UIResourceId resource_id) OVERRIDE; + virtual UIResourceProvider& GetUIResourceProvider() OVERRIDE; // LayerTreeHostClient implementation. virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} @@ -140,6 +136,7 @@ class CONTENT_EXPORT CompositorImpl scoped_refptr root_layer_; scoped_ptr host_; + content::UIResourceProviderImpl ui_resource_provider_; gfx::Size size_; bool has_transparent_background_; @@ -150,10 +147,6 @@ class CONTENT_EXPORT CompositorImpl CompositorClient* client_; - typedef base::ScopedPtrHashMap - UIResourceMap; - UIResourceMap ui_resource_map_; - gfx::NativeWindow root_window_; // Used locally to track whether a call to LTH::Composite() did result in -- cgit v1.1