| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_EXAMPLES_COMPOSITOR_APP_COMPOSITOR_HOST_H_ | |
| 6 #define MOJO_EXAMPLES_COMPOSITOR_APP_COMPOSITOR_HOST_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "base/threading/thread.h" | |
| 10 #include "cc/trees/layer_tree_host_client.h" | |
| 11 #include "mojo/public/cpp/system/core.h" | |
| 12 #include "ui/gfx/size.h" | |
| 13 | |
| 14 namespace cc { | |
| 15 class Layer; | |
| 16 class LayerTreeHost; | |
| 17 } // namespace cc | |
| 18 | |
| 19 namespace mojo { | |
| 20 namespace examples { | |
| 21 class GLES2ClientImpl; | |
| 22 | |
| 23 class CompositorHost : public cc::LayerTreeHostClient { | |
| 24 public: | |
| 25 explicit CompositorHost(ScopedMessagePipeHandle command_buffer_handle); | |
| 26 virtual ~CompositorHost(); | |
| 27 | |
| 28 void SetSize(const gfx::Size& viewport_size); | |
| 29 | |
| 30 // cc::LayerTreeHostClient implementation. | |
| 31 virtual void WillBeginMainFrame(int frame_id) override; | |
| 32 virtual void DidBeginMainFrame() override; | |
| 33 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) override; | |
| 34 virtual void Layout() override; | |
| 35 virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, | |
| 36 const gfx::Vector2d& outer_delta, | |
| 37 float page_scale, | |
| 38 float top_controls_delta) override; | |
| 39 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, | |
| 40 float page_scale, | |
| 41 float top_controls_delta) override; | |
| 42 virtual void RequestNewOutputSurface(bool fallback) override; | |
| 43 virtual void DidInitializeOutputSurface() override; | |
| 44 virtual void WillCommit() override; | |
| 45 virtual void DidCommit() override; | |
| 46 virtual void DidCommitAndDrawFrame() override; | |
| 47 virtual void DidCompleteSwapBuffers() override; | |
| 48 | |
| 49 private: | |
| 50 void SetupScene(); | |
| 51 | |
| 52 ScopedMessagePipeHandle command_buffer_handle_; | |
| 53 scoped_ptr<cc::LayerTreeHost> tree_; | |
| 54 scoped_refptr<cc::Layer> child_layer_; | |
| 55 base::Thread compositor_thread_; | |
| 56 }; | |
| 57 | |
| 58 } // namespace examples | |
| 59 } // namespace mojo | |
| 60 | |
| 61 #endif // MOJO_EXAMPLES_COMPOSITOR_APP_COMPOSITOR_HOST_H_ | |
| OLD | NEW |