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

Unified Diff: content/renderer/android/synchronous_compositor_output_surface.h

Issue 15002007: Delegate root layer scroll offset to android_webview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/renderer/android/synchronous_compositor_output_surface.h
diff --git a/content/renderer/android/synchronous_compositor_output_surface.h b/content/renderer/android/synchronous_compositor_output_surface.h
index 9f09ae5fa17026a5c8cec91de19bd754dc4c598d..00144b44a300f00ff64048d254ea6685de481a6d 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.h
+++ b/content/renderer/android/synchronous_compositor_output_surface.h
@@ -3,11 +3,12 @@
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
-#define CONTENT_RENDERER_ANDOIRD_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
+#define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "cc/output/output_surface.h"
#include "content/public/renderer/android/synchronous_compositor.h"
@@ -25,10 +26,23 @@ class WebGraphicsContext3DCommandBufferImpl;
// This class can be created only on the main thread, but then becomes pinned
// to a fixed thread when BindToClient is called.
class SynchronousCompositorOutputSurface
- : NON_EXPORTED_BASE(public cc::OutputSurface),
- NON_EXPORTED_BASE(public SynchronousCompositor) {
+ : NON_EXPORTED_BASE(public cc::OutputSurface) {
public:
- explicit SynchronousCompositorOutputSurface(int32 routing_id);
+ class Delegate {
joth 2013/05/16 18:21:42 the emerging preference is not to do inner classes
+ public:
+ virtual void SetContinuousInvalidate(bool enable) = 0;
+ virtual void DidCreateSynchronousCompositor() = 0;
+ virtual void DidDestroyCompositor() = 0;
joth 2013/05/16 18:21:42 the extra layer of delegate delegation is unfortun
+
+ protected:
+ Delegate() {}
+ virtual ~Delegate() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+ };
+
+ explicit SynchronousCompositorOutputSurface(Delegate* delegate);
virtual ~SynchronousCompositorOutputSurface();
// OutputSurface.
@@ -39,15 +53,12 @@ class SynchronousCompositorOutputSurface
virtual void EnableVSyncNotification(bool enable_vsync) OVERRIDE;
virtual void SwapBuffers(const cc::LatencyInfo& info) OVERRIDE;
- // SynchronousCompositor.
- virtual void SetClient(SynchronousCompositorClient* compositor_client)
- OVERRIDE;
- virtual bool IsHwReady() OVERRIDE;
- virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE;
- virtual bool DemandDrawHw(
- gfx::Size view_size,
- const gfx::Transform& transform,
- gfx::Rect clip) OVERRIDE;
+ // Partial SynchronousCompositor API implementation.
+ bool IsHwReady();
+ bool DemandDrawSw(SkCanvas* canvas);
+ bool DemandDrawHw(gfx::Size view_size,
+ const gfx::Transform& transform,
+ gfx::Rect clip);
private:
class SoftwareDevice;
@@ -58,8 +69,7 @@ class SynchronousCompositorOutputSurface
void NotifyCompositorSettingsChanged();
bool CalledOnValidThread() const;
- SynchronousCompositorClient* compositor_client_;
- int routing_id_;
+ Delegate* delegate_;
bool vsync_enabled_;
bool did_swap_buffer_;

Powered by Google App Engine
This is Rietveld 408576698