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 CCLayerTreeHost_h | 5 #ifndef CCLayerTreeHost_h |
6 #define CCLayerTreeHost_h | 6 #define CCLayerTreeHost_h |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "IntRect.h" | 10 #include "IntRect.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 bool usingSetVisibility; | 85 bool usingSetVisibility; |
86 bool usingSwapCompleteCallback; | 86 bool usingSwapCompleteCallback; |
87 bool usingGpuMemoryManager; | 87 bool usingGpuMemoryManager; |
88 bool usingDiscardFramebuffer; | 88 bool usingDiscardFramebuffer; |
89 bool usingEglImage; | 89 bool usingEglImage; |
90 int maxTextureSize; | 90 int maxTextureSize; |
91 }; | 91 }; |
92 | 92 |
93 class LayerTreeHost : public RateLimiterClient { | 93 class LayerTreeHost : public RateLimiterClient { |
94 public: | 94 public: |
95 static scoped_ptr<LayerTreeHost> create(LayerTreeHostClient*, const LayerTre
eSettings&); | 95 static scoped_ptr<LayerTreeHost> create(LayerTreeHostClient*, const LayerTre
eSettings&, Thread* implThread); |
96 virtual ~LayerTreeHost(); | 96 virtual ~LayerTreeHost(); |
97 | 97 |
98 void setSurfaceReady(); | 98 void setSurfaceReady(); |
99 | 99 |
100 // Returns true if any LayerTreeHost is alive. | 100 // Returns true if any LayerTreeHost is alive. |
101 static bool anyLayerTreeHostInstanceExists(); | 101 static bool anyLayerTreeHostInstanceExists(); |
102 | 102 |
103 static bool needsFilterContext() { return s_needsFilterContext; } | 103 static bool needsFilterContext() { return s_needsFilterContext; } |
104 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo
ntext = needsFilterContext; } | 104 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo
ntext = needsFilterContext; } |
105 bool needsSharedContext() const { return needsFilterContext() || settings().
acceleratePainting; } | 105 bool needsSharedContext() const { return needsFilterContext() || settings().
acceleratePainting; } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 bool bufferedUpdates(); | 203 bool bufferedUpdates(); |
204 bool requestPartialTextureUpdate(); | 204 bool requestPartialTextureUpdate(); |
205 | 205 |
206 void setDeviceScaleFactor(float); | 206 void setDeviceScaleFactor(float); |
207 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 207 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
208 | 208 |
209 void setFontAtlas(scoped_ptr<FontAtlas>); | 209 void setFontAtlas(scoped_ptr<FontAtlas>); |
210 | 210 |
211 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } | 211 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } |
212 | 212 |
| 213 Proxy* proxy() const { return m_proxy.get(); } |
| 214 |
213 protected: | 215 protected: |
214 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); | 216 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); |
215 bool initialize(); | 217 bool initialize(Thread* implThread); |
216 | 218 |
217 private: | 219 private: |
218 typedef std::vector<scoped_refptr<Layer> > LayerList; | 220 typedef std::vector<scoped_refptr<Layer> > LayerList; |
219 | 221 |
220 void initializeRenderer(); | 222 void initializeRenderer(); |
221 | 223 |
222 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); | 224 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); |
223 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); | 225 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); |
224 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); | 226 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); |
225 | 227 |
226 void updateLayers(Layer*, ResourceUpdateQueue&); | 228 void updateLayers(Layer*, ResourceUpdateQueue&); |
227 void triggerPrepaint(); | 229 void triggerPrepaint(); |
228 | 230 |
229 void prioritizeTextures(const LayerList&, OverdrawMetrics&); | 231 void prioritizeTextures(const LayerList&, OverdrawMetrics&); |
230 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 232 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
231 void setPrioritiesForLayers(const LayerList&); | 233 void setPrioritiesForLayers(const LayerList&); |
232 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 234 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
233 | 235 |
234 void animateLayers(base::TimeTicks monotonicTime); | 236 void animateLayers(base::TimeTicks monotonicTime); |
235 bool animateLayersRecursive(Layer* current, base::TimeTicks time); | 237 bool animateLayersRecursive(Layer* current, base::TimeTicks time); |
236 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); | 238 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); |
237 | 239 |
238 bool m_animating; | 240 bool m_animating; |
239 bool m_needsAnimateLayers; | 241 bool m_needsAnimateLayers; |
240 | 242 |
241 base::CancelableClosure m_prepaintCallback; | 243 base::CancelableClosure m_prepaintCallback; |
242 | 244 |
243 LayerTreeHostClient* m_client; | 245 LayerTreeHostClient* m_client; |
| 246 scoped_ptr<Proxy> m_proxy; |
244 | 247 |
245 int m_commitNumber; | 248 int m_commitNumber; |
246 RenderingStats m_renderingStats; | 249 RenderingStats m_renderingStats; |
247 | 250 |
248 scoped_ptr<Proxy> m_proxy; | |
249 bool m_rendererInitialized; | 251 bool m_rendererInitialized; |
250 bool m_contextLost; | 252 bool m_contextLost; |
251 int m_numTimesRecreateShouldFail; | 253 int m_numTimesRecreateShouldFail; |
252 int m_numFailedRecreateAttempts; | 254 int m_numFailedRecreateAttempts; |
253 | 255 |
254 scoped_refptr<Layer> m_rootLayer; | 256 scoped_refptr<Layer> m_rootLayer; |
255 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; | 257 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; |
256 scoped_ptr<FontAtlas> m_fontAtlas; | 258 scoped_ptr<FontAtlas> m_fontAtlas; |
257 | 259 |
258 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager; | 260 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager; |
(...skipping 22 matching lines...) Expand all Loading... |
281 size_t m_partialTextureUpdateRequests; | 283 size_t m_partialTextureUpdateRequests; |
282 | 284 |
283 static bool s_needsFilterContext; | 285 static bool s_needsFilterContext; |
284 | 286 |
285 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 287 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
286 }; | 288 }; |
287 | 289 |
288 } // namespace cc | 290 } // namespace cc |
289 | 291 |
290 #endif | 292 #endif |
OLD | NEW |