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

Side by Side Diff: cc/trees/thread_proxy.h

Issue 151093005: cc: Update Main RendererCapabilities on DeferredInitialize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DCHECK in TextureLayer::OnOutputSurfaceCreated Created 6 years, 10 months 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
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 CC_TREES_THREAD_PROXY_H_ 5 #ifndef CC_TREES_THREAD_PROXY_H_
6 #define CC_TREES_THREAD_PROXY_H_ 6 #define CC_TREES_THREAD_PROXY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 virtual void Start() OVERRIDE; 64 virtual void Start() OVERRIDE;
65 virtual void Stop() OVERRIDE; 65 virtual void Stop() OVERRIDE;
66 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; 66 virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
67 virtual void AcquireLayerTextures() OVERRIDE; 67 virtual void AcquireLayerTextures() OVERRIDE;
68 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; 68 virtual void ForceSerializeOnSwapBuffers() OVERRIDE;
69 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; 69 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE;
70 virtual bool CommitPendingForTesting() OVERRIDE; 70 virtual bool CommitPendingForTesting() OVERRIDE;
71 virtual scoped_ptr<base::Value> SchedulerStateAsValueForTesting() OVERRIDE; 71 virtual scoped_ptr<base::Value> SchedulerStateAsValueForTesting() OVERRIDE;
72 72
73 // LayerTreeHostImplClient implementation 73 // LayerTreeHostImplClient implementation
74 virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE;
74 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; 75 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE;
75 virtual void DidSwapBuffersOnImplThread() OVERRIDE {} 76 virtual void DidSwapBuffersOnImplThread() OVERRIDE {}
76 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; 77 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE;
77 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE; 78 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE;
78 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; 79 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE;
79 virtual void NotifyReadyToActivate() OVERRIDE; 80 virtual void NotifyReadyToActivate() OVERRIDE;
80 // Please call these 2 functions through 81 // Please call these 2 functions through
81 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect(). 82 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect().
82 virtual void SetNeedsRedrawOnImplThread() OVERRIDE; 83 virtual void SetNeedsRedrawOnImplThread() OVERRIDE;
83 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) 84 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 ~BeginMainFrameAndCommitState(); 133 ~BeginMainFrameAndCommitState();
133 134
134 base::TimeTicks monotonic_frame_begin_time; 135 base::TimeTicks monotonic_frame_begin_time;
135 scoped_ptr<ScrollAndScaleSet> scroll_info; 136 scoped_ptr<ScrollAndScaleSet> scroll_info;
136 size_t memory_allocation_limit_bytes; 137 size_t memory_allocation_limit_bytes;
137 int memory_allocation_priority_cutoff; 138 int memory_allocation_priority_cutoff;
138 bool evicted_ui_resources; 139 bool evicted_ui_resources;
139 }; 140 };
140 141
141 // Called on main thread. 142 // Called on main thread.
143 void SetRendererCapabilitiesMainThreadCopy(
144 const RendererCapabilities& capabilities);
142 void BeginMainFrame( 145 void BeginMainFrame(
143 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); 146 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state);
144 void DidCommitAndDrawFrame(); 147 void DidCommitAndDrawFrame();
145 void DidCompleteSwapBuffers(); 148 void DidCompleteSwapBuffers();
146 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, 149 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue,
147 base::Time wall_clock_time); 150 base::Time wall_clock_time);
148 void DoCreateAndInitializeOutputSurface(); 151 void DoCreateAndInitializeOutputSurface();
149 // |capabilities| is set only when |success| is true. 152 // |capabilities| is set only when |success| is true.
150 void OnOutputSurfaceInitializeAttempted( 153 void OnOutputSurfaceInitializeAttempted(
151 bool success, 154 bool success,
152 const RendererCapabilities& capabilities); 155 const RendererCapabilities& capabilities);
153 void SendCommitRequestToImplThreadIfNeeded(); 156 void SendCommitRequestToImplThreadIfNeeded();
154 157
155 // Called on impl thread. 158 // Called on impl thread.
156 struct ReadbackRequest; 159 struct ReadbackRequest;
157 struct CommitPendingRequest; 160 struct CommitPendingRequest;
158 struct SchedulerStateRequest; 161 struct SchedulerStateRequest;
159 162
160 void ForceCommitForReadbackOnImplThread( 163 void ForceCommitForReadbackOnImplThread(
161 CompletionEvent* begin_main_frame_sent_completion, 164 CompletionEvent* begin_main_frame_sent_completion,
162 ReadbackRequest* request); 165 ReadbackRequest* request);
163 void StartCommitOnImplThread( 166 void StartCommitOnImplThread(
164 CompletionEvent* completion, 167 CompletionEvent* completion,
165 ResourceUpdateQueue* queue, 168 ResourceUpdateQueue* queue,
166 scoped_refptr<ContextProvider> offscreen_context_provider); 169 scoped_refptr<ContextProvider> offscreen_context_provider,
170 const RendererCapabilities& main_frame_renderer_caps);
167 void BeginMainFrameAbortedOnImplThread(bool did_handle); 171 void BeginMainFrameAbortedOnImplThread(bool did_handle);
168 void RequestReadbackOnImplThread(ReadbackRequest* request); 172 void RequestReadbackOnImplThread(ReadbackRequest* request);
169 void FinishAllRenderingOnImplThread(CompletionEvent* completion); 173 void FinishAllRenderingOnImplThread(CompletionEvent* completion);
170 void InitializeImplOnImplThread(CompletionEvent* completion, 174 void InitializeImplOnImplThread(CompletionEvent* completion,
171 int layer_tree_host_id); 175 int layer_tree_host_id);
172 void SetLayerTreeHostClientReadyOnImplThread(); 176 void SetLayerTreeHostClientReadyOnImplThread();
173 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible); 177 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible);
174 void UpdateBackgroundAnimateTicking(); 178 void UpdateBackgroundAnimateTicking();
175 void HasInitializedOutputSurfaceOnImplThread( 179 void HasInitializedOutputSurfaceOnImplThread(
176 CompletionEvent* completion, 180 CompletionEvent* completion,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // Set when the main thread is waiting on a 271 // Set when the main thread is waiting on a
268 // ScheduledActionSendBeginMainFrame to be issued. 272 // ScheduledActionSendBeginMainFrame to be issued.
269 CompletionEvent* begin_main_frame_sent_completion_event; 273 CompletionEvent* begin_main_frame_sent_completion_event;
270 274
271 // Set when the main thread is waiting on a readback. 275 // Set when the main thread is waiting on a readback.
272 ReadbackRequest* readback_request; 276 ReadbackRequest* readback_request;
273 277
274 // Set when the main thread is waiting on a commit to complete. 278 // Set when the main thread is waiting on a commit to complete.
275 CompletionEvent* commit_completion_event; 279 CompletionEvent* commit_completion_event;
276 280
281 // The main renderer capabilities used for this commit. used to check
282 // for renderer capability staleness.
283 RendererCapabilities renderer_capabilities_for_commit;
284
277 // Set when the main thread is waiting on a pending tree activation. 285 // Set when the main thread is waiting on a pending tree activation.
278 CompletionEvent* completion_event_for_commit_held_on_tree_activation; 286 CompletionEvent* completion_event_for_commit_held_on_tree_activation;
279 287
280 // Set when the main thread is waiting on layers to be drawn. 288 // Set when the main thread is waiting on layers to be drawn.
281 CompletionEvent* texture_acquisition_completion_event; 289 CompletionEvent* texture_acquisition_completion_event;
282 290
283 scoped_ptr<ResourceUpdateController> current_resource_update_controller; 291 scoped_ptr<ResourceUpdateController> current_resource_update_controller;
284 292
285 // Set when the next draw should post DidCommitAndDrawFrame to the main 293 // Set when the next draw should post DidCommitAndDrawFrame to the main
286 // thread. 294 // thread.
(...skipping 30 matching lines...) Expand all
317 325
318 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; 326 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_;
319 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; 327 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_;
320 328
321 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); 329 DISALLOW_COPY_AND_ASSIGN(ThreadProxy);
322 }; 330 };
323 331
324 } // namespace cc 332 } // namespace cc
325 333
326 #endif // CC_TREES_THREAD_PROXY_H_ 334 #endif // CC_TREES_THREAD_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698