| 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..a2b84dfd2dd5d5d00b7cf34d474f67b4baa46897 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"
|
|
|
| @@ -16,6 +17,9 @@ namespace content {
|
| class SynchronousCompositorClient;
|
| class WebGraphicsContext3DCommandBufferImpl;
|
|
|
| +// TODO(mkosiba): Update comment.
|
| +//
|
| +//
|
| // Specialization of the output surface that adapts it to implement the
|
| // content::SynchronousCompositor public API. This class effects an "inversion
|
| // of control" - enabling drawing to be orchestrated by the embedding
|
| @@ -25,10 +29,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 {
|
| + public:
|
| + virtual void SetContinuousInvalidate(bool enable) = 0;
|
| + virtual void DidCreateSynchronousCompositor() = 0;
|
| + virtual void DidDestroyCompositor() = 0;
|
| +
|
| + protected:
|
| + Delegate() {}
|
| + virtual ~Delegate() {}
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(Delegate);
|
| + };
|
| +
|
| + explicit SynchronousCompositorOutputSurface(Delegate* delegate);
|
| virtual ~SynchronousCompositorOutputSurface();
|
|
|
| // OutputSurface.
|
| @@ -39,15 +56,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 +72,7 @@ class SynchronousCompositorOutputSurface
|
| void NotifyCompositorSettingsChanged();
|
| bool CalledOnValidThread() const;
|
|
|
| - SynchronousCompositorClient* compositor_client_;
|
| - int routing_id_;
|
| + Delegate* delegate_;
|
| bool vsync_enabled_;
|
| bool did_swap_buffer_;
|
|
|
|
|