Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: cc/thread_proxy.h

Issue 11416043: Merge 167537 - Use message passing for BeginFrameAndCommitState and clean up forced commit logic (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/scheduler_state_machine_unittest.cc ('k') | cc/thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CCThreadProxy_h 5 #ifndef CCThreadProxy_h
6 #define CCThreadProxy_h 6 #define CCThreadProxy_h
7 7
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "cc/animation_events.h" 9 #include "cc/animation_events.h"
10 #include "cc/completion_event.h" 10 #include "cc/completion_event.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; 74 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE;
75 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE; 75 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE;
76 76
77 // ResourceUpdateControllerClient implementation 77 // ResourceUpdateControllerClient implementation
78 virtual void readyToFinalizeTextureUpdates() OVERRIDE; 78 virtual void readyToFinalizeTextureUpdates() OVERRIDE;
79 79
80 private: 80 private:
81 explicit ThreadProxy(LayerTreeHost*); 81 explicit ThreadProxy(LayerTreeHost*);
82 friend class ThreadProxyContextRecreationTimer; 82 friend class ThreadProxyContextRecreationTimer;
83 83
84 // Set on impl thread, read on main thread.
85 struct BeginFrameAndCommitState { 84 struct BeginFrameAndCommitState {
86 BeginFrameAndCommitState(); 85 BeginFrameAndCommitState();
87 ~BeginFrameAndCommitState(); 86 ~BeginFrameAndCommitState();
88 87
89 base::TimeTicks monotonicFrameBeginTime; 88 base::TimeTicks monotonicFrameBeginTime;
90 scoped_ptr<ScrollAndScaleSet> scrollInfo; 89 scoped_ptr<ScrollAndScaleSet> scrollInfo;
91 WebKit::WebTransformationMatrix implTransform; 90 WebKit::WebTransformationMatrix implTransform;
92 PrioritizedTextureManager::BackingList evictedContentsTexturesBackings; 91 PrioritizedTextureManager::BackingList evictedContentsTexturesBackings;
93 size_t memoryAllocationLimitBytes; 92 size_t memoryAllocationLimitBytes;
94 }; 93 };
95 scoped_ptr<BeginFrameAndCommitState> m_pendingBeginFrameRequest;
96 94
97 // Called on main thread 95 // Called on main thread
98 void beginFrame(); 96 void beginFrame(BeginFrameAndCommitState* beginFrameState);
99 void didCommitAndDrawFrame(); 97 void didCommitAndDrawFrame();
100 void didCompleteSwapBuffers(); 98 void didCompleteSwapBuffers();
101 void setAnimationEvents(AnimationEventsVector*, base::Time wallClockTime); 99 void setAnimationEvents(AnimationEventsVector*, base::Time wallClockTime);
102 void beginContextRecreation(); 100 void beginContextRecreation();
103 void tryToRecreateContext(); 101 void tryToRecreateContext();
104 102
105 // Called on impl thread 103 // Called on impl thread
106 struct ReadbackRequest { 104 struct ReadbackRequest {
107 CompletionEvent completion; 105 CompletionEvent completion;
108 bool success; 106 bool success;
(...skipping 17 matching lines...) Expand all
126 void recreateContextOnImplThread(CompletionEvent*, GraphicsContext*, bool* r ecreateSucceeded, RendererCapabilities*); 124 void recreateContextOnImplThread(CompletionEvent*, GraphicsContext*, bool* r ecreateSucceeded, RendererCapabilities*);
127 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); 125 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*);
128 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for cedDraw); 126 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for cedDraw);
129 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); 127 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*);
130 void setNeedsForcedCommitOnImplThread(); 128 void setNeedsForcedCommitOnImplThread();
131 129
132 // Accessed on main thread only. 130 // Accessed on main thread only.
133 bool m_animateRequested; // Set only when setNeedsAnimate is called. 131 bool m_animateRequested; // Set only when setNeedsAnimate is called.
134 bool m_commitRequested; // Set only when setNeedsCommit is called. 132 bool m_commitRequested; // Set only when setNeedsCommit is called.
135 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA nimate. 133 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA nimate.
136 bool m_forcedCommitRequested;
137 scoped_ptr<ThreadProxyContextRecreationTimer> m_contextRecreationTimer; 134 scoped_ptr<ThreadProxyContextRecreationTimer> m_contextRecreationTimer;
138 LayerTreeHost* m_layerTreeHost; 135 LayerTreeHost* m_layerTreeHost;
139 bool m_rendererInitialized; 136 bool m_rendererInitialized;
140 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; 137 RendererCapabilities m_RendererCapabilitiesMainThreadCopy;
141 bool m_started; 138 bool m_started;
142 bool m_texturesAcquired; 139 bool m_texturesAcquired;
143 bool m_inCompositeAndReadback; 140 bool m_inCompositeAndReadback;
144 141
145 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; 142 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl;
146 143
(...skipping 23 matching lines...) Expand all
170 167
171 // Set when the next draw should post didCommitAndDrawFrame to the main thre ad. 168 // Set when the next draw should post didCommitAndDrawFrame to the main thre ad.
172 bool m_nextFrameIsNewlyCommittedFrameOnImplThread; 169 bool m_nextFrameIsNewlyCommittedFrameOnImplThread;
173 170
174 bool m_renderVSyncEnabled; 171 bool m_renderVSyncEnabled;
175 172
176 base::TimeDelta m_totalCommitTime; 173 base::TimeDelta m_totalCommitTime;
177 size_t m_totalCommitCount; 174 size_t m_totalCommitCount;
178 175
179 bool m_deferCommits; 176 bool m_deferCommits;
180 bool m_deferredCommitPending; 177 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit;
181 }; 178 };
182 179
183 } // namespace cc 180 } // namespace cc
184 181
185 #endif 182 #endif
OLDNEW
« no previous file with comments | « cc/scheduler_state_machine_unittest.cc ('k') | cc/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698