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

Side by Side Diff: cc/thread_proxy.h

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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_THREAD_PROXY_H_ 5 #ifndef CC_THREAD_PROXY_H_
6 #define CC_THREAD_PROXY_H_ 6 #define CC_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"
11 #include "cc/animation_events.h" 11 #include "cc/animation_events.h"
12 #include "cc/completion_event.h" 12 #include "cc/completion_event.h"
13 #include "cc/layer_tree_host_impl.h" 13 #include "cc/layer_tree_host_impl.h"
14 #include "cc/proxy.h" 14 #include "cc/proxy.h"
15 #include "cc/resource_update_controller.h" 15 #include "cc/resource_update_controller.h"
16 #include "cc/scheduler.h" 16 #include "cc/scheduler.h"
17 17
18 namespace WebKit {
19 class WebGraphicsContext3D;
20 }
21
18 namespace cc { 22 namespace cc {
19 23
20 class InputHandler; 24 class InputHandler;
21 class LayerTreeHost; 25 class LayerTreeHost;
22 class ResourceUpdateQueue; 26 class ResourceUpdateQueue;
23 class Scheduler; 27 class Scheduler;
24 class ScopedThreadProxy; 28 class ScopedThreadProxy;
25 class Thread; 29 class Thread;
26 30
27 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso urceUpdateControllerClient { 31 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso urceUpdateControllerClient {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 CompletionEvent completion; 119 CompletionEvent completion;
116 bool success; 120 bool success;
117 void* pixels; 121 void* pixels;
118 gfx::Rect rect; 122 gfx::Rect rect;
119 }; 123 };
120 struct CommitPendingRequest { 124 struct CommitPendingRequest {
121 CompletionEvent completion; 125 CompletionEvent completion;
122 bool commitPending; 126 bool commitPending;
123 }; 127 };
124 void forceBeginFrameOnImplThread(CompletionEvent*); 128 void forceBeginFrameOnImplThread(CompletionEvent*);
125 void beginFrameCompleteOnImplThread(CompletionEvent*, ResourceUpdateQueue*); 129 void beginFrameCompleteOnImplThread(CompletionEvent*, ResourceUpdateQueue*, WebKit::WebGraphicsContext3D* offscreenContext3d, GrContext* offscreenGrContext) ;
126 void beginFrameAbortedOnImplThread(); 130 void beginFrameAbortedOnImplThread();
127 void requestReadbackOnImplThread(ReadbackRequest*); 131 void requestReadbackOnImplThread(ReadbackRequest*);
128 void requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration); 132 void requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration);
129 void finishAllRenderingOnImplThread(CompletionEvent*); 133 void finishAllRenderingOnImplThread(CompletionEvent*);
130 void initializeImplOnImplThread(CompletionEvent*, InputHandler*); 134 void initializeImplOnImplThread(CompletionEvent*, InputHandler*);
131 void setSurfaceReadyOnImplThread(); 135 void setSurfaceReadyOnImplThread();
132 void setVisibleOnImplThread(CompletionEvent*, bool); 136 void setVisibleOnImplThread(CompletionEvent*, bool);
133 void initializeOutputSurfaceOnImplThread(scoped_ptr<OutputSurface>); 137 void initializeOutputSurfaceOnImplThread(scoped_ptr<OutputSurface>);
134 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee ded, RendererCapabilities*); 138 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee ded, RendererCapabilities*);
135 void layerTreeHostClosedOnImplThread(CompletionEvent*); 139 void layerTreeHostClosedOnImplThread(CompletionEvent*);
136 void manageTilesOnImplThread(); 140 void manageTilesOnImplThread();
137 void setFullRootLayerDamageOnImplThread(); 141 void setFullRootLayerDamageOnImplThread();
138 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); 142 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*);
139 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu rface>, bool* recreateSucceeded, RendererCapabilities*); 143 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu rface>, WebKit::WebGraphicsContext3D* offscreenContext3d, GrContext* offscreenGr Context, bool* recreateSucceeded, RendererCapabilities*);
140 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); 144 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*);
141 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for cedDraw); 145 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for cedDraw);
142 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); 146 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*);
143 void setNeedsForcedCommitOnImplThread(); 147 void setNeedsForcedCommitOnImplThread();
144 void checkOutputSurfaceStatusOnImplThread(); 148 void checkOutputSurfaceStatusOnImplThread();
145 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request); 149 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request);
146 void capturePictureOnImplThread(CompletionEvent*, skia::RefPtr<SkPicture>*); 150 void capturePictureOnImplThread(CompletionEvent*, skia::RefPtr<SkPicture>*);
147 void renewTreePriorityOnImplThread(); 151 void renewTreePriorityOnImplThread();
148 152
149 // Accessed on main thread only. 153 // Accessed on main thread only.
150 bool m_animateRequested; // Set only when setNeedsAnimate is called. 154 bool m_animateRequested; // Set only when setNeedsAnimate is called.
151 bool m_commitRequested; // Set only when setNeedsCommit is called. 155 bool m_commitRequested; // Set only when setNeedsCommit is called.
152 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA nimate. 156 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA nimate.
153 base::CancelableClosure m_outputSurfaceRecreationCallback; 157 base::CancelableClosure m_outputSurfaceRecreationCallback;
154 LayerTreeHost* m_layerTreeHost; 158 LayerTreeHost* m_layerTreeHost;
155 bool m_rendererInitialized; 159 bool m_rendererInitialized;
156 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; 160 RendererCapabilities m_RendererCapabilitiesMainThreadCopy;
157 bool m_started; 161 bool m_started;
158 bool m_texturesAcquired; 162 bool m_texturesAcquired;
159 bool m_inCompositeAndReadback; 163 bool m_inCompositeAndReadback;
160 bool m_manageTilesPending; 164 bool m_manageTilesPending;
165
161 // Weak pointer to use when posting tasks to the impl thread. 166 // Weak pointer to use when posting tasks to the impl thread.
162 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr; 167 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr;
163 168
164 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread; 169 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread;
165 170
166 base::WeakPtr<ThreadProxy> m_mainThreadWeakPtr; 171 base::WeakPtr<ThreadProxy> m_mainThreadWeakPtr;
167 base::WeakPtrFactory<ThreadProxy> m_weakFactory; 172 base::WeakPtrFactory<ThreadProxy> m_weakFactory;
168 173
169 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; 174 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl;
170 175
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool m_deferCommits; 211 bool m_deferCommits;
207 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; 212 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit;
208 213
209 base::TimeTicks m_smoothnessTakesPriorityExpirationTime; 214 base::TimeTicks m_smoothnessTakesPriorityExpirationTime;
210 bool m_renewTreePriorityOnImplThreadPending; 215 bool m_renewTreePriorityOnImplThreadPending;
211 }; 216 };
212 217
213 } // namespace cc 218 } // namespace cc
214 219
215 #endif // CC_THREAD_PROXY_H_ 220 #endif // CC_THREAD_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698