| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_SINGLE_THREAD_PROXY_H_ | 5 #ifndef CC_SINGLE_THREAD_PROXY_H_ |
| 6 #define CC_SINGLE_THREAD_PROXY_H_ | 6 #define CC_SINGLE_THREAD_PROXY_H_ |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #include "cc/animation_events.h" | 11 #include "cc/animation_events.h" |
| 12 #include "cc/layer_tree_host_impl.h" | 12 #include "cc/layer_tree_host_impl.h" |
| 13 #include "cc/proxy.h" | 13 #include "cc/proxy.h" |
| 14 | 14 |
| 15 namespace ui { |
| 16 class ContextProvider; |
| 17 } |
| 18 |
| 15 namespace cc { | 19 namespace cc { |
| 16 | 20 |
| 17 class LayerTreeHost; | 21 class LayerTreeHost; |
| 18 | 22 |
| 19 class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { | 23 class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { |
| 20 public: | 24 public: |
| 21 static scoped_ptr<Proxy> create(LayerTreeHost*); | 25 static scoped_ptr<Proxy> create(LayerTreeHost*); |
| 22 virtual ~SingleThreadProxy(); | 26 virtual ~SingleThreadProxy(); |
| 23 | 27 |
| 24 // Proxy implementation | 28 // Proxy implementation |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual void renewTreePriority() OVERRIDE { } | 70 virtual void renewTreePriority() OVERRIDE { } |
| 67 | 71 |
| 68 // Called by the legacy path where RenderWidget does the scheduling. | 72 // Called by the legacy path where RenderWidget does the scheduling. |
| 69 void compositeImmediately(); | 73 void compositeImmediately(); |
| 70 | 74 |
| 71 private: | 75 private: |
| 72 explicit SingleThreadProxy(LayerTreeHost*); | 76 explicit SingleThreadProxy(LayerTreeHost*); |
| 73 | 77 |
| 74 bool commitAndComposite(); | 78 bool commitAndComposite(); |
| 75 void doCommit(scoped_ptr<ResourceUpdateQueue>); | 79 void doCommit(scoped_ptr<ResourceUpdateQueue>); |
| 76 bool doComposite(); | 80 bool doComposite(scoped_refptr<ui::ContextProvider> offscreenContextProvider
); |
| 77 void didSwapFrame(); | 81 void didSwapFrame(); |
| 78 | 82 |
| 79 // Accessed on main thread only. | 83 // Accessed on main thread only. |
| 80 LayerTreeHost* m_layerTreeHost; | 84 LayerTreeHost* m_layerTreeHost; |
| 81 bool m_outputSurfaceLost; | 85 bool m_outputSurfaceLost; |
| 86 bool m_createdOffscreenContextProvider; |
| 82 | 87 |
| 83 // Holds on to the context between initializeContext() and initializeRendere
r() calls. Shouldn't | 88 // Holds on to the context between initializeContext() and initializeRendere
r() calls. Shouldn't |
| 84 // be used for anything else. | 89 // be used for anything else. |
| 85 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitialization; | 90 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitialization; |
| 86 | 91 |
| 87 // Used on the Thread, but checked on main thread during initialization/shut
down. | 92 // Used on the Thread, but checked on main thread during initialization/shut
down. |
| 88 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; | 93 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; |
| 89 bool m_rendererInitialized; | 94 bool m_rendererInitialized; |
| 90 RendererCapabilities m_RendererCapabilitiesForMainThread; | 95 RendererCapabilities m_RendererCapabilitiesForMainThread; |
| 91 | 96 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 { | 159 { |
| 155 } | 160 } |
| 156 private: | 161 private: |
| 157 DebugScopedSetImplThread m_implThread; | 162 DebugScopedSetImplThread m_implThread; |
| 158 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; | 163 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; |
| 159 }; | 164 }; |
| 160 | 165 |
| 161 } // namespace cc | 166 } // namespace cc |
| 162 | 167 |
| 163 #endif // CC_SINGLE_THREAD_PROXY_H_ | 168 #endif // CC_SINGLE_THREAD_PROXY_H_ |
| OLD | NEW |