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

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

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cc refactors to reduce duplication Created 7 years, 7 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 "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE; 54 virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE;
55 virtual void Stop() OVERRIDE; 55 virtual void Stop() OVERRIDE;
56 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; 56 virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
57 virtual void AcquireLayerTextures() OVERRIDE; 57 virtual void AcquireLayerTextures() OVERRIDE;
58 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; 58 virtual void ForceSerializeOnSwapBuffers() OVERRIDE;
59 virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE; 59 virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE;
60 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; 60 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE;
61 virtual bool CommitPendingForTesting() OVERRIDE; 61 virtual bool CommitPendingForTesting() OVERRIDE;
62 62
63 // LayerTreeHostImplClient implementation 63 // LayerTreeHostImplClient implementation
64 virtual void DidUpdateCapabilitiesOnImplThread(
65 bool success,
66 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE;
64 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; 67 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE;
65 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; 68 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE;
66 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, 69 virtual void OnVSyncParametersChanged(base::TimeTicks timebase,
67 base::TimeDelta interval) OVERRIDE; 70 base::TimeDelta interval) OVERRIDE;
68 virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) 71 virtual void BeginFrameOnImplThread(base::TimeTicks frame_time)
69 OVERRIDE; 72 OVERRIDE;
70 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; 73 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE;
71 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE; 74 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE;
72 virtual void SetNeedsRedrawOnImplThread() OVERRIDE; 75 virtual void SetNeedsRedrawOnImplThread() OVERRIDE;
73 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect dirty_rect) OVERRIDE; 76 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect dirty_rect) OVERRIDE;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 }; 133 };
131 134
132 // Called on main thread. 135 // Called on main thread.
133 void BeginFrameOnMainThread( 136 void BeginFrameOnMainThread(
134 scoped_ptr<BeginFrameAndCommitState> begin_frame_state); 137 scoped_ptr<BeginFrameAndCommitState> begin_frame_state);
135 void DidCommitAndDrawFrame(); 138 void DidCommitAndDrawFrame();
136 void DidCompleteSwapBuffers(); 139 void DidCompleteSwapBuffers();
137 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue, 140 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue,
138 base::Time wall_clock_time); 141 base::Time wall_clock_time);
139 void DoCreateAndInitializeOutputSurface(); 142 void DoCreateAndInitializeOutputSurface();
143 void DidUpdateCapabilities();
140 // |capabilities| is set only when |success| is true. 144 // |capabilities| is set only when |success| is true.
141 void OnOutputSurfaceInitializeAttempted( 145 void OnOutputSurfaceInitializeAttempted(
142 bool success, 146 bool success,
143 const RendererCapabilities& capabilities); 147 const RendererCapabilities& capabilities);
144 148
145 // Called on impl thread. 149 // Called on impl thread.
146 struct ReadbackRequest { 150 struct ReadbackRequest {
147 CompletionEvent completion; 151 CompletionEvent completion;
148 bool success; 152 bool success;
149 void* pixels; 153 void* pixels;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 bool started_; 212 bool started_;
209 bool textures_acquired_; 213 bool textures_acquired_;
210 bool in_composite_and_readback_; 214 bool in_composite_and_readback_;
211 bool manage_tiles_pending_; 215 bool manage_tiles_pending_;
212 // Weak pointer to use when posting tasks to the impl thread. 216 // Weak pointer to use when posting tasks to the impl thread.
213 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; 217 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_;
214 // Holds the first output surface passed from Start. Should not be used for 218 // Holds the first output surface passed from Start. Should not be used for
215 // anything else. 219 // anything else.
216 scoped_ptr<OutputSurface> first_output_surface_; 220 scoped_ptr<OutputSurface> first_output_surface_;
217 221
222 bool initializing_new_output_surface__on_impl_thread_;
223
218 base::WeakPtrFactory<ThreadProxy> weak_factory_on_impl_thread_; 224 base::WeakPtrFactory<ThreadProxy> weak_factory_on_impl_thread_;
219 225
220 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; 226 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_;
221 base::WeakPtrFactory<ThreadProxy> weak_factory_; 227 base::WeakPtrFactory<ThreadProxy> weak_factory_;
222 228
223 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_; 229 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_;
224 230
225 scoped_ptr<Scheduler> scheduler_on_impl_thread_; 231 scoped_ptr<Scheduler> scheduler_on_impl_thread_;
226 232
227 // Set when the main thread is waiting on a 233 // Set when the main thread is waiting on a
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 266
261 base::TimeTicks smoothness_takes_priority_expiration_time_; 267 base::TimeTicks smoothness_takes_priority_expiration_time_;
262 bool renew_tree_priority_on_impl_thread_pending_; 268 bool renew_tree_priority_on_impl_thread_pending_;
263 269
264 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); 270 DISALLOW_COPY_AND_ASSIGN(ThreadProxy);
265 }; 271 };
266 272
267 } // namespace cc 273 } // namespace cc
268 274
269 #endif // CC_TREES_THREAD_PROXY_H_ 275 #endif // CC_TREES_THREAD_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698