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

Unified Diff: cc/surfaces/display.h

Issue 302903003: Add very simple cc::Display implementation for surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « cc/cc.gyp ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display.h
diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h
new file mode 100644
index 0000000000000000000000000000000000000000..309f58f68f2508eb3bc7e181489d3a6ec52aa8f5
--- /dev/null
+++ b/cc/surfaces/display.h
@@ -0,0 +1,87 @@
+// Copyright 2014 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.
+
+#include "base/memory/scoped_ptr.h"
+
+#include "cc/layers/delegated_frame_resource_collection.h"
+#include "cc/layers/delegated_renderer_layer.h"
+#include "cc/output/output_surface_client.h"
+#include "cc/surfaces/surface_aggregator.h"
+#include "cc/surfaces/surface_client.h"
+#include "cc/surfaces/surfaces_export.h"
+#include "cc/trees/layer_tree_host_client.h"
+#include "cc/trees/layer_tree_host_single_thread_client.h"
+
+namespace gfx {
+class Size;
+}
+
+namespace cc {
+
+class DirectRenderer;
+class DisplayClient;
+class LayerTreeHost;
+class OutputSurface;
+class ResourceProvider;
+class Surface;
+class SurfaceManager;
+
+class CC_SURFACES_EXPORT Display
+ : public SurfaceClient,
+ public DelegatedFrameResourceCollectionClient,
+ NON_EXPORTED_BASE(public LayerTreeHostClient),
+ NON_EXPORTED_BASE(public LayerTreeHostSingleThreadClient) {
+ public:
+ Display(DisplayClient* client, SurfaceManager* manager);
+ virtual ~Display();
+
+ void Resize(const gfx::Size& new_size);
+ bool Draw();
+
+ int CurrentSurfaceID();
+
+ // LayerTreeHostClient implementation.
+ virtual void WillBeginMainFrame(int frame_id) OVERRIDE {}
+ virtual void DidBeginMainFrame() OVERRIDE {}
+ virtual void Animate(base::TimeTicks frame_begin_time) OVERRIDE {}
+ virtual void Layout() OVERRIDE {}
+ virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta,
+ float page_scale) OVERRIDE {}
+ virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) OVERRIDE;
+ virtual void DidInitializeOutputSurface() OVERRIDE {}
+ virtual void WillCommit() OVERRIDE {}
+ virtual void DidCommit() OVERRIDE {}
+ virtual void DidCommitAndDrawFrame() OVERRIDE {}
+ virtual void DidCompleteSwapBuffers() OVERRIDE {}
+
+ // LayerTreeHostSingleThreadClient implementation.
+ virtual void ScheduleComposite() OVERRIDE;
+ virtual void ScheduleAnimation() OVERRIDE;
+ virtual void DidPostSwapBuffers() OVERRIDE {}
+ virtual void DidAbortSwapBuffers() OVERRIDE {}
+
+ // DelegatedFrameResourceCollectionClient implementation.
+ virtual void UnusedResourcesAreAvailable() OVERRIDE {}
+
+ // SurfaceClient implementation.
+ virtual void ReturnResources(const ReturnedResourceArray& resources) OVERRIDE;
+
+ private:
+ void DoComposite();
+
+ bool scheduled_draw_;
+
+ DisplayClient* client_;
+ SurfaceManager* manager_;
+ SurfaceAggregator aggregator_;
+ scoped_ptr<Surface> current_surface_;
+ scoped_ptr<LayerTreeHost> layer_tree_host_;
+ scoped_refptr<DelegatedFrameResourceCollection> resource_collection_;
+ scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_;
+ scoped_refptr<DelegatedRendererLayer> delegated_layer_;
+
+ DISALLOW_COPY_AND_ASSIGN(Display);
+};
+
+} // namespace cc
« no previous file with comments | « cc/cc.gyp ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698