Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2396)

Unified Diff: content/browser/renderer_host/compositor_impl_android.h

Issue 26753005: Adding compositor callbacks to RenderWidgetHostViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change RWHVA to add itself to the compositor as per sievers@ comment Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: 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 66eb07d88dbcec3115cdc79b5dc7a2decdd0460b..286a6ec1b02b860b15534199f3ede02d0bfeb4c5 100644
--- a/content/browser/renderer_host/compositor_impl_android.h
+++ b/content/browser/renderer_host/compositor_impl_android.h
@@ -10,6 +10,7 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "cc/resources/ui_resource_client.h"
#include "cc/trees/layer_tree_host_client.h"
#include "content/browser/renderer_host/image_transport_factory_android.h"
@@ -28,6 +29,7 @@ class ScopedUIResource;
namespace content {
class CompositorClient;
+class CompositorObserver;
class GraphicsContext;
// -----------------------------------------------------------------------------
@@ -82,7 +84,7 @@ class CONTENT_EXPORT CompositorImpl
OVERRIDE;
virtual void DidInitializeOutputSurface(bool success) OVERRIDE {}
virtual void WillCommit() OVERRIDE {}
- virtual void DidCommit() OVERRIDE {}
+ virtual void DidCommit() OVERRIDE;
virtual void DidCommitAndDrawFrame() OVERRIDE {}
virtual void DidCompleteSwapBuffers() OVERRIDE;
virtual void ScheduleComposite() OVERRIDE;
@@ -97,6 +99,12 @@ class CONTENT_EXPORT CompositorImpl
// ImageTransportFactoryAndroidObserver implementation.
virtual void OnLostResources() OVERRIDE;
+ // Compositor does not own observers. It is the responsibility of the
+ // observer to remove itself when it is done observing.
+ virtual void AddObserver(CompositorObserver* observer) OVERRIDE;
+ virtual void RemoveObserver(CompositorObserver* observer) OVERRIDE;
+ virtual bool HasObserver(CompositorObserver* observer) OVERRIDE;
+
private:
WebKit::WebGLId BuildBasicTexture();
WebKit::WGC3Denum GetGLFormatForBitmap(gfx::JavaBitmap& bitmap);
@@ -120,6 +128,8 @@ class CONTENT_EXPORT CompositorImpl
UIResourceMap;
UIResourceMap ui_resource_map_;
+ ObserverList<CompositorObserver> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
};

Powered by Google App Engine
This is Rietveld 408576698