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

Unified Diff: content/browser/android/in_process/synchronous_compositor_output_surface.h

Issue 16119003: Move SynchronousCompositor into content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment, check 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/browser/android/in_process/synchronous_compositor_output_surface.h
diff --git a/content/renderer/android/synchronous_compositor_output_surface.h b/content/browser/android/in_process/synchronous_compositor_output_surface.h
similarity index 59%
rename from content/renderer/android/synchronous_compositor_output_surface.h
rename to content/browser/android/in_process/synchronous_compositor_output_surface.h
index 611d424e60de526ea4ff6b58337c84d5e9226674..b2236c2dc47f8be8289a89e86e19237e142a18be 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.h
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
-#define CONTENT_RENDERER_ANDOIRD_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
+#ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
+#define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -14,21 +14,34 @@
namespace content {
class SynchronousCompositorClient;
+class SynchronousCompositorOutputSurface;
class WebGraphicsContext3DCommandBufferImpl;
+class SynchronousCompositorOutputSurfaceDelegate {
+ public:
+ virtual void DidBindOutputSurface(
+ SynchronousCompositorOutputSurface* output_surface) = 0;
+ virtual void DidDestroySynchronousOutputSurface(
+ SynchronousCompositorOutputSurface* output_surface) = 0;
+ virtual void SetContinuousInvalidate(bool enable) = 0;
+
+ protected:
+ SynchronousCompositorOutputSurfaceDelegate() {}
+ virtual ~SynchronousCompositorOutputSurfaceDelegate() {}
+};
+
// 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
// layer, instead of driven by the compositor internals - hence it holds two
-// 'client' pointers (including |client_| in the OutputSurface baseclass) which
-// represent the consumers of the two roles in plays.
+// 'client' pointers (|client_| in the OutputSurface baseclass and
+// GetDelegate()) which represent the consumers of the two roles in plays.
// 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);
+ explicit SynchronousCompositorOutputSurface(int routing_id);
virtual ~SynchronousCompositorOutputSurface();
// OutputSurface.
@@ -39,15 +52,12 @@ class SynchronousCompositorOutputSurface
virtual void SetNeedsBeginFrame(bool enable) OVERRIDE;
virtual void SwapBuffers(const ui::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;
@@ -57,8 +67,8 @@ class SynchronousCompositorOutputSurface
void UpdateCompositorClientSettings();
void NotifyCompositorSettingsChanged();
bool CalledOnValidThread() const;
+ SynchronousCompositorOutputSurfaceDelegate* GetDelegate();
- SynchronousCompositorClient* compositor_client_;
int routing_id_;
bool needs_begin_frame_;
bool did_swap_buffer_;
@@ -71,4 +81,4 @@ class SynchronousCompositorOutputSurface
} // namespace content
-#endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
+#endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_

Powered by Google App Engine
This is Rietveld 408576698