| 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 "CCAnimationEvents.h" | 8 #include "CCAnimationEvents.h" |
| 9 #include "CCGraphicsContext.h" | 9 #include "CCGraphicsContext.h" |
| 10 #include "CCLayerTreeHostClient.h" | 10 #include "CCLayerTreeHostClient.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // CCLayerTreeHost interface to CCProxy. | 117 // CCLayerTreeHost interface to CCProxy. |
| 118 void willBeginFrame() { m_client->willBeginFrame(); } | 118 void willBeginFrame() { m_client->willBeginFrame(); } |
| 119 void didBeginFrame() { m_client->didBeginFrame(); } | 119 void didBeginFrame() { m_client->didBeginFrame(); } |
| 120 void updateAnimations(double monotonicFrameBeginTime); | 120 void updateAnimations(double monotonicFrameBeginTime); |
| 121 void layout(); | 121 void layout(); |
| 122 void beginCommitOnImplThread(CCLayerTreeHostImpl*); | 122 void beginCommitOnImplThread(CCLayerTreeHostImpl*); |
| 123 void finishCommitOnImplThread(CCLayerTreeHostImpl*); | 123 void finishCommitOnImplThread(CCLayerTreeHostImpl*); |
| 124 void willCommit(); | 124 void willCommit(); |
| 125 void commitComplete(); | 125 void commitComplete(); |
| 126 PassOwnPtr<CCGraphicsContext> createContext(); | 126 PassOwnPtr<CCGraphicsContext> createContext(); |
| 127 PassOwnPtr<CCInputHandler> createInputHandler(); |
| 127 virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(CCLayerTreeH
ostImplClient*); | 128 virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(CCLayerTreeH
ostImplClient*); |
| 128 void didLoseContext(); | 129 void didLoseContext(); |
| 129 enum RecreateResult { | 130 enum RecreateResult { |
| 130 RecreateSucceeded, | 131 RecreateSucceeded, |
| 131 RecreateFailedButTryAgain, | 132 RecreateFailedButTryAgain, |
| 132 RecreateFailedAndGaveUp, | 133 RecreateFailedAndGaveUp, |
| 133 }; | 134 }; |
| 134 RecreateResult recreateContext(); | 135 RecreateResult recreateContext(); |
| 135 void didCommitAndDrawFrame() { m_client->didCommitAndDrawFrame(); } | 136 void didCommitAndDrawFrame() { m_client->didCommitAndDrawFrame(); } |
| 136 void didCompleteSwapBuffers() { m_client->didCompleteSwapBuffers(); } | 137 void didCompleteSwapBuffers() { m_client->didCompleteSwapBuffers(); } |
| 137 void deleteContentsTexturesOnImplThread(CCResourceProvider*); | 138 void deleteContentsTexturesOnImplThread(CCResourceProvider*); |
| 138 virtual void acquireLayerTextures(); | 139 virtual void acquireLayerTextures(); |
| 139 // Returns false if we should abort this frame due to initialization failure
. | 140 // Returns false if we should abort this frame due to initialization failure
. |
| 140 bool initializeRendererIfNeeded(); | 141 bool initializeRendererIfNeeded(); |
| 141 void updateLayers(CCTextureUpdateQueue&, size_t contentsMemoryLimitBytes); | 142 void updateLayers(CCTextureUpdateQueue&, size_t contentsMemoryLimitBytes); |
| 142 | 143 |
| 143 CCLayerTreeHostClient* client() { return m_client; } | 144 CCLayerTreeHostClient* client() { return m_client; } |
| 144 | 145 |
| 145 int compositorIdentifier() const { return m_compositorIdentifier; } | |
| 146 | |
| 147 // Only used when compositing on the main thread. | 146 // Only used when compositing on the main thread. |
| 148 void composite(); | 147 void composite(); |
| 149 void scheduleComposite(); | 148 void scheduleComposite(); |
| 150 | 149 |
| 151 // Composites and attempts to read back the result into the provided | 150 // Composites and attempts to read back the result into the provided |
| 152 // buffer. If it wasn't possible, e.g. due to context lost, will return | 151 // buffer. If it wasn't possible, e.g. due to context lost, will return |
| 153 // false. | 152 // false. |
| 154 bool compositeAndReadback(void *pixels, const IntRect&); | 153 bool compositeAndReadback(void *pixels, const IntRect&); |
| 155 | 154 |
| 156 void finishAllRendering(); | 155 void finishAllRendering(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 239 |
| 241 void prioritizeTextures(const LayerList&, CCOverdrawMetrics&); | 240 void prioritizeTextures(const LayerList&, CCOverdrawMetrics&); |
| 242 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 241 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
| 243 void setPrioritiesForLayers(const LayerList&); | 242 void setPrioritiesForLayers(const LayerList&); |
| 244 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 243 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
| 245 | 244 |
| 246 void animateLayers(double monotonicTime); | 245 void animateLayers(double monotonicTime); |
| 247 bool animateLayersRecursive(LayerChromium* current, double monotonicTime); | 246 bool animateLayersRecursive(LayerChromium* current, double monotonicTime); |
| 248 void setAnimationEventsRecursive(const CCAnimationEventsVector&, LayerChromi
um*, double wallClockTime); | 247 void setAnimationEventsRecursive(const CCAnimationEventsVector&, LayerChromi
um*, double wallClockTime); |
| 249 | 248 |
| 250 int m_compositorIdentifier; | |
| 251 | |
| 252 bool m_animating; | 249 bool m_animating; |
| 253 bool m_needsAnimateLayers; | 250 bool m_needsAnimateLayers; |
| 254 | 251 |
| 255 CCLayerTreeHostClient* m_client; | 252 CCLayerTreeHostClient* m_client; |
| 256 | 253 |
| 257 int m_commitNumber; | 254 int m_commitNumber; |
| 258 CCRenderingStats m_renderingStats; | 255 CCRenderingStats m_renderingStats; |
| 259 | 256 |
| 260 OwnPtr<CCProxy> m_proxy; | 257 OwnPtr<CCProxy> m_proxy; |
| 261 bool m_rendererInitialized; | 258 bool m_rendererInitialized; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 290 | 287 |
| 291 TextureList m_deleteTextureAfterCommitList; | 288 TextureList m_deleteTextureAfterCommitList; |
| 292 size_t m_partialTextureUpdateRequests; | 289 size_t m_partialTextureUpdateRequests; |
| 293 | 290 |
| 294 static bool s_needsFilterContext; | 291 static bool s_needsFilterContext; |
| 295 }; | 292 }; |
| 296 | 293 |
| 297 } | 294 } |
| 298 | 295 |
| 299 #endif | 296 #endif |
| OLD | NEW |