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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual bool commitPendingForTesting() OVERRIDE; | 47 virtual bool commitPendingForTesting() OVERRIDE; |
48 virtual skia::RefPtr<SkPicture> capturePicture() OVERRIDE; | 48 virtual skia::RefPtr<SkPicture> capturePicture() OVERRIDE; |
49 | 49 |
50 // LayerTreeHostImplClient implementation | 50 // LayerTreeHostImplClient implementation |
51 virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE { } | 51 virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE { } |
52 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; | 52 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; |
53 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE { } | 53 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE { } |
54 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } | 54 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } |
55 virtual void onHasPendingTreeStateChanged(bool havePendingTree) OVERRIDE; | 55 virtual void onHasPendingTreeStateChanged(bool havePendingTree) OVERRIDE; |
56 virtual void setNeedsRedrawOnImplThread() OVERRIDE; | 56 virtual void setNeedsRedrawOnImplThread() OVERRIDE; |
| 57 virtual void didSwapUseIncompleteTextureOnImplThread() OVERRIDE; |
| 58 virtual void didUploadVisibleHighResolutionTileOnImplTread() OVERRIDE; |
57 virtual void setNeedsCommitOnImplThread() OVERRIDE; | 59 virtual void setNeedsCommitOnImplThread() OVERRIDE; |
58 virtual void setNeedsManageTilesOnImplThread() OVERRIDE; | 60 virtual void setNeedsManageTilesOnImplThread() OVERRIDE; |
59 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) OVERRIDE; | 61 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) OVERRIDE; |
60 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE; | 62 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE; |
61 virtual void sendManagedMemoryStats() OVERRIDE; | 63 virtual void sendManagedMemoryStats() OVERRIDE; |
| 64 virtual bool isInsideDraw() OVERRIDE; |
62 | 65 |
63 // Called by the legacy path where RenderWidget does the scheduling. | 66 // Called by the legacy path where RenderWidget does the scheduling. |
64 void compositeImmediately(); | 67 void compositeImmediately(); |
65 | 68 |
66 private: | 69 private: |
67 explicit SingleThreadProxy(LayerTreeHost*); | 70 explicit SingleThreadProxy(LayerTreeHost*); |
68 | 71 |
69 bool commitAndComposite(); | 72 bool commitAndComposite(); |
70 void doCommit(scoped_ptr<ResourceUpdateQueue>); | 73 void doCommit(scoped_ptr<ResourceUpdateQueue>); |
71 bool doComposite(); | 74 bool doComposite(); |
72 void didSwapFrame(); | 75 void didSwapFrame(); |
73 | 76 |
74 // Accessed on main thread only. | 77 // Accessed on main thread only. |
75 LayerTreeHost* m_layerTreeHost; | 78 LayerTreeHost* m_layerTreeHost; |
76 bool m_outputSurfaceLost; | 79 bool m_outputSurfaceLost; |
77 | 80 |
78 // Holds on to the context between initializeContext() and initializeRendere
r() calls. Shouldn't | 81 // Holds on to the context between initializeContext() and initializeRendere
r() calls. Shouldn't |
79 // be used for anything else. | 82 // be used for anything else. |
80 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitialization; | 83 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitialization; |
81 | 84 |
82 // Used on the Thread, but checked on main thread during initialization/shut
down. | 85 // Used on the Thread, but checked on main thread during initialization/shut
down. |
83 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; | 86 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; |
84 bool m_rendererInitialized; | 87 bool m_rendererInitialized; |
85 RendererCapabilities m_RendererCapabilitiesForMainThread; | 88 RendererCapabilities m_RendererCapabilitiesForMainThread; |
86 | 89 |
87 bool m_nextFrameIsNewlyCommittedFrame; | 90 bool m_nextFrameIsNewlyCommittedFrame; |
88 | 91 |
| 92 bool m_insideDraw; |
| 93 |
89 base::TimeDelta m_totalCommitTime; | 94 base::TimeDelta m_totalCommitTime; |
90 size_t m_totalCommitCount; | 95 size_t m_totalCommitCount; |
91 }; | 96 }; |
92 | 97 |
93 // For use in the single-threaded case. In debug builds, it pretends that the | 98 // For use in the single-threaded case. In debug builds, it pretends that the |
94 // code is running on the impl thread to satisfy assertion checks. | 99 // code is running on the impl thread to satisfy assertion checks. |
95 class DebugScopedSetImplThread { | 100 class DebugScopedSetImplThread { |
96 public: | 101 public: |
97 explicit DebugScopedSetImplThread(Proxy* proxy) | 102 explicit DebugScopedSetImplThread(Proxy* proxy) |
98 : m_proxy(proxy) | 103 : m_proxy(proxy) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 { | 152 { |
148 } | 153 } |
149 private: | 154 private: |
150 DebugScopedSetImplThread m_implThread; | 155 DebugScopedSetImplThread m_implThread; |
151 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; | 156 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; |
152 }; | 157 }; |
153 | 158 |
154 } // namespace cc | 159 } // namespace cc |
155 | 160 |
156 #endif // CC_SINGLE_THREAD_PROXY_H_ | 161 #endif // CC_SINGLE_THREAD_PROXY_H_ |
OLD | NEW |