| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_TREES_LAYER_TREE_HOST_CLIENT_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_CLIENT_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 virtual void DidBeginMainFrame() = 0; | 28 virtual void DidBeginMainFrame() = 0; |
| 29 virtual void Layout() = 0; | 29 virtual void Layout() = 0; |
| 30 virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, | 30 virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, |
| 31 const gfx::Vector2d& outer_delta, | 31 const gfx::Vector2d& outer_delta, |
| 32 float page_scale, | 32 float page_scale, |
| 33 float top_controls_delta) = 0; | 33 float top_controls_delta) = 0; |
| 34 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, | 34 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, |
| 35 float page_scale, | 35 float page_scale, |
| 36 float top_controls_delta) = 0; | 36 float top_controls_delta) = 0; |
| 37 // Request an OutputSurface from the client. When the client has one it should | 37 // Request an OutputSurface from the client. When the client has one it should |
| 38 // call LayerTreeHost::SetOutputSurface. If fallback is true, it should | 38 // call LayerTreeHost::SetOutputSurface. This will result in either |
| 39 // attempt to create an OutputSurface that is guaranteed to initialize | 39 // DidFailToInitializeOutputSurface or DidInitializeOutputSurface being |
| 40 // correctly. | 40 // called. |
| 41 virtual void RequestNewOutputSurface(bool fallback) = 0; | 41 virtual void RequestNewOutputSurface() = 0; |
| 42 virtual void DidInitializeOutputSurface() = 0; | 42 virtual void DidInitializeOutputSurface() = 0; |
| 43 virtual void DidFailToInitializeOutputSurface() = 0; |
| 43 virtual void WillCommit() = 0; | 44 virtual void WillCommit() = 0; |
| 44 virtual void DidCommit() = 0; | 45 virtual void DidCommit() = 0; |
| 45 virtual void DidCommitAndDrawFrame() = 0; | 46 virtual void DidCommitAndDrawFrame() = 0; |
| 46 virtual void DidCompleteSwapBuffers() = 0; | 47 virtual void DidCompleteSwapBuffers() = 0; |
| 47 | 48 |
| 48 // TODO(simonhong): Makes this to pure virtual function when client | 49 // TODO(simonhong): Makes this to pure virtual function when client |
| 49 // implementation is ready. | 50 // implementation is ready. |
| 50 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} | 51 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} |
| 51 | 52 |
| 52 // Requests that the client insert a rate limiting token in the shared main | 53 // Requests that the client insert a rate limiting token in the shared main |
| 53 // thread context's command stream that will block if the context gets too far | 54 // thread context's command stream that will block if the context gets too far |
| 54 // ahead of the compositor's command stream. Only needed if the tree contains | 55 // ahead of the compositor's command stream. Only needed if the tree contains |
| 55 // a TextureLayer that calls SetRateLimitContext(true). | 56 // a TextureLayer that calls SetRateLimitContext(true). |
| 56 virtual void RateLimitSharedMainThreadContext() {} | 57 virtual void RateLimitSharedMainThreadContext() {} |
| 57 | 58 |
| 58 // This hook is for testing. | |
| 59 virtual void DidFailToInitializeOutputSurface() {} | |
| 60 | |
| 61 protected: | 59 protected: |
| 62 virtual ~LayerTreeHostClient() {} | 60 virtual ~LayerTreeHostClient() {} |
| 63 }; | 61 }; |
| 64 | 62 |
| 65 } // namespace cc | 63 } // namespace cc |
| 66 | 64 |
| 67 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ | 65 #endif // CC_TREES_LAYER_TREE_HOST_CLIENT_H_ |
| OLD | NEW |