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

Unified Diff: content/browser/aura/browser_compositor_output_surface.h

Issue 23726015: All together now (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screencast_cap
Patch Set: Created 7 years, 4 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
« no previous file with comments | « ash/shell.cc ('k') | content/browser/aura/browser_compositor_output_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/aura/browser_compositor_output_surface.h
diff --git a/content/browser/aura/browser_compositor_output_surface.h b/content/browser/aura/browser_compositor_output_surface.h
index f9ec3c8d9d5a9b2ea1a54e78a517e8b0d9f1532d..f6174284d49537a294509ea249cfa1f514793a41 100644
--- a/content/browser/aura/browser_compositor_output_surface.h
+++ b/content/browser/aura/browser_compositor_output_surface.h
@@ -7,6 +7,7 @@
#include "base/id_map.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "base/threading/non_thread_safe.h"
#include "cc/output/output_surface.h"
@@ -16,7 +17,6 @@ namespace ui { class Compositor; }
namespace content {
class ContextProviderCommandBuffer;
-class ReflectorImpl;
class WebGraphicsContext3DCommandBufferImpl;
// Adapts a WebGraphicsContext3DCommandBufferImpl into a
@@ -26,11 +26,29 @@ class BrowserCompositorOutputSurface
: public cc::OutputSurface,
public base::NonThreadSafe {
public:
+ // Observer class for objects to be notified of events on the output surface.
+ // These will be called on the the thread the BrowserCompositorOutputSurface
+ // binds to in BindToClient().
+ class Observer {
+ public:
+ // Called when the output surface's size has changed.
+ virtual void OnReshape(const gfx::Size& size) = 0;
+
+ // Called when the output surface swaps to the frontbuffer.
+ virtual void OnSwapBuffers() = 0;
+
+ // Called when the output surface posts a subbuffer to the frontbuffer.
+ virtual void OnPostSubBuffer(const gfx::Rect& rect) = 0;
+
+ // Called when the output surface is about to be deleted.
+ virtual void OnDelete() = 0;
+ };
+
BrowserCompositorOutputSurface(
const scoped_refptr<ContextProviderCommandBuffer>& context,
int surface_id,
IDMap<BrowserCompositorOutputSurface>* output_surface_map,
- base::MessageLoopProxy* compositor_message_loop,
+ const scoped_refptr<base::MessageLoopProxy>& compositor_message_loop,
base::WeakPtr<ui::Compositor> compositor);
virtual ~BrowserCompositorOutputSurface();
@@ -43,7 +61,8 @@ class BrowserCompositorOutputSurface
void OnUpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval);
- void SetReflector(ReflectorImpl* reflector);
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
private:
int surface_id_;
@@ -51,7 +70,7 @@ class BrowserCompositorOutputSurface
scoped_refptr<base::MessageLoopProxy> compositor_message_loop_;
base::WeakPtr<ui::Compositor> compositor_;
- scoped_refptr<ReflectorImpl> reflector_;
+ ObserverList<Observer> observer_list_;
};
} // namespace content
« no previous file with comments | « ash/shell.cc ('k') | content/browser/aura/browser_compositor_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698