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

Unified Diff: content/browser/android/in_process/synchronous_compositor_impl.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_impl.h
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.h b/content/browser/android/in_process/synchronous_compositor_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..b067a6ff7df3045430497990207e2d969b2751fe
--- /dev/null
+++ b/content/browser/android/in_process/synchronous_compositor_impl.h
@@ -0,0 +1,69 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_
+#define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/browser/android/in_process/synchronous_compositor_output_surface.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "content/public/renderer/android/synchronous_compositor.h"
+
+namespace content {
+
+// The purpose of this class is to act as the intermediary between the various
+// components that make up the 'synchronous compositor mode' implementation and
+// expose their functionality via the SynchronousCompositor interface.
+// This class is created on the main thread but most of the APIs are called
+// from the Compositor thread.
+class SynchronousCompositorImpl
+ : public SynchronousCompositor,
+ public SynchronousCompositorOutputSurfaceDelegate,
+ public WebContentsUserData<SynchronousCompositorImpl> {
+ public:
+ // Implementation detail: must be called once on startup in
+ // configurations where the syncrhonous compositor feature is required.
+ static void InitFactory();
+ static SynchronousCompositorImpl* FromRoutingID(int routing_id);
+
+ virtual ~SynchronousCompositorImpl();
+
+ // SynchronousCompositor
+ virtual bool IsHwReady() OVERRIDE;
+ virtual void SetClient(SynchronousCompositorClient* compositor_client)
+ OVERRIDE;
+ virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE;
+ virtual bool DemandDrawHw(
+ gfx::Size view_size,
+ const gfx::Transform& transform,
+ gfx::Rect clip) OVERRIDE;
+
+ // SynchronousCompositorOutputSurfaceDelegate
+ virtual void DidBindOutputSurface(
+ SynchronousCompositorOutputSurface* output_surface) OVERRIDE;
+ virtual void DidDestroySynchronousOutputSurface(
+ SynchronousCompositorOutputSurface* output_surface) OVERRIDE;
+ virtual void SetContinuousInvalidate(bool enable) OVERRIDE;
+
+ private:
+ explicit SynchronousCompositorImpl(WebContents* contents);
+ friend class WebContentsUserData<SynchronousCompositorImpl>;
+
+ void DidCreateSynchronousOutputSurface(
+ SynchronousCompositorOutputSurface* output_surface);
+ bool CalledOnValidThread() const;
+
+ int routing_id_;
+ SynchronousCompositorClient* compositor_client_;
+ SynchronousCompositorOutputSurface* output_surface_;
+ WebContents* contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_
« no previous file with comments | « content/browser/android/in_process/DEPS ('k') | content/browser/android/in_process/synchronous_compositor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698