Chromium Code Reviews| Index: cc/surfaces/display.h |
| diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ba0eb6492a81b4b753a11332b820bc8089a294c0 |
| --- /dev/null |
| +++ b/cc/surfaces/display.h |
| @@ -0,0 +1,84 @@ |
| +// 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(); |
| + |
| + virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} |
|
jamesr
2014/05/28 22:01:28
add some sort of comment indicating that these are
|
| + 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 {} |
| + |
| + virtual void ScheduleComposite() OVERRIDE; |
|
jamesr
2014/05/28 22:01:28
ditto for LTHSTClient
|
| + virtual void ScheduleAnimation() OVERRIDE { ScheduleComposite(); } |
| + virtual void DidPostSwapBuffers() OVERRIDE {} |
| + virtual void DidAbortSwapBuffers() OVERRIDE {} |
| + |
| + virtual void UnusedResourcesAreAvailable() OVERRIDE {} |
|
jamesr
2014/05/28 22:01:28
same for DFRCC
|
| + |
| + // 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 |