summaryrefslogtreecommitdiff
path: root/chromium/cc/trees/layer_tree_host_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/cc/trees/layer_tree_host_client.h')
-rw-r--r--chromium/cc/trees/layer_tree_host_client.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/chromium/cc/trees/layer_tree_host_client.h b/chromium/cc/trees/layer_tree_host_client.h
new file mode 100644
index 00000000000..9e11f7cbd5d
--- /dev/null
+++ b/chromium/cc/trees/layer_tree_host_client.h
@@ -0,0 +1,58 @@
+// Copyright 2012 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 CC_TREES_LAYER_TREE_HOST_CLIENT_H_
+#define CC_TREES_LAYER_TREE_HOST_CLIENT_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace gfx {
+class Vector2d;
+}
+
+namespace cc {
+class ContextProvider;
+class InputHandlerClient;
+class OutputSurface;
+
+class LayerTreeHostClient {
+ public:
+ virtual void WillBeginFrame() = 0;
+ // Marks finishing compositing-related tasks on the main thread. In threaded
+ // mode, this corresponds to DidCommit().
+ virtual void DidBeginFrame() = 0;
+ virtual void Animate(double frame_begin_time) = 0;
+ virtual void Layout() = 0;
+ virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta,
+ float page_scale) = 0;
+ // Creates an OutputSurface. If fallback is true, it should attempt to
+ // create an OutputSurface that is guaranteed to initialize correctly.
+ virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) = 0;
+ virtual void DidInitializeOutputSurface(bool success) = 0;
+ virtual void WillCommit() = 0;
+ virtual void DidCommit() = 0;
+ virtual void DidCommitAndDrawFrame() = 0;
+ virtual void DidCompleteSwapBuffers() = 0;
+
+ // Used only in the single-threaded path.
+ virtual void ScheduleComposite() = 0;
+
+ // These must always return a valid ContextProvider. But the provider does not
+ // need to be capable of creating contexts.
+ virtual scoped_refptr<cc::ContextProvider>
+ OffscreenContextProviderForMainThread() = 0;
+ virtual scoped_refptr<cc::ContextProvider>
+ OffscreenContextProviderForCompositorThread() = 0;
+
+ // This hook is for testing.
+ virtual void DidFailToInitializeOutputSurface() {}
+
+ protected:
+ virtual ~LayerTreeHostClient() {}
+};
+
+} // namespace cc
+
+#endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_