| 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 "CCAnimationEvents.h" | 10 #include "CCAnimationEvents.h" | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 45 class CCTextureUpdateQueue; | 45 class CCTextureUpdateQueue; | 
| 46 class HeadsUpDisplayLayerChromium; | 46 class HeadsUpDisplayLayerChromium; | 
| 47 class Region; | 47 class Region; | 
| 48 struct CCScrollAndScaleSet; | 48 struct CCScrollAndScaleSet; | 
| 49 | 49 | 
| 50 struct CCLayerTreeSettings { | 50 struct CCLayerTreeSettings { | 
| 51     CCLayerTreeSettings(); | 51     CCLayerTreeSettings(); | 
| 52     ~CCLayerTreeSettings(); | 52     ~CCLayerTreeSettings(); | 
| 53 | 53 | 
| 54     bool acceleratePainting; | 54     bool acceleratePainting; | 
| 55     bool showFPSCounter; |  | 
| 56     bool showPlatformLayerTree; | 55     bool showPlatformLayerTree; | 
| 57     bool showPaintRects; | 56     bool showPaintRects; | 
| 58     bool showPropertyChangedRects; | 57     bool showPropertyChangedRects; | 
| 59     bool showSurfaceDamageRects; | 58     bool showSurfaceDamageRects; | 
| 60     bool showScreenSpaceRects; | 59     bool showScreenSpaceRects; | 
| 61     bool showReplicaScreenSpaceRects; | 60     bool showReplicaScreenSpaceRects; | 
| 62     bool showOccludingRects; | 61     bool showOccludingRects; | 
| 63     bool renderVSyncEnabled; | 62     bool renderVSyncEnabled; | 
| 64     double refreshRate; | 63     double refreshRate; | 
| 65     size_t maxPartialTextureUpdates; | 64     size_t maxPartialTextureUpdates; | 
| 66     IntSize defaultTileSize; | 65     IntSize defaultTileSize; | 
| 67     IntSize maxUntiledLayerSize; | 66     IntSize maxUntiledLayerSize; | 
| 68     IntSize minimumOcclusionTrackingSize; | 67     IntSize minimumOcclusionTrackingSize; | 
| 69 | 68 | 
| 70     bool showDebugInfo() const { return showPlatformLayerTree || showFPSCounter 
     || showDebugRects(); } |  | 
| 71     bool showDebugRects() const { return showPaintRects || showPropertyChangedRe
     cts || showSurfaceDamageRects || showScreenSpaceRects || showReplicaScreenSpaceR
     ects || showOccludingRects; } | 69     bool showDebugRects() const { return showPaintRects || showPropertyChangedRe
     cts || showSurfaceDamageRects || showScreenSpaceRects || showReplicaScreenSpaceR
     ects || showOccludingRects; } | 
| 72 }; | 70 }; | 
| 73 | 71 | 
| 74 // Provides information on an Impl's rendering capabilities back to the CCLayerT
     reeHost | 72 // Provides information on an Impl's rendering capabilities back to the CCLayerT
     reeHost | 
| 75 struct RendererCapabilities { | 73 struct RendererCapabilities { | 
| 76     RendererCapabilities(); | 74     RendererCapabilities(); | 
| 77     ~RendererCapabilities(); | 75     ~RendererCapabilities(); | 
| 78 | 76 | 
| 79     GLenum bestTextureFormat; | 77     GLenum bestTextureFormat; | 
| 80     bool contextHasCachedFrontBuffer; | 78     bool contextHasCachedFrontBuffer; | 
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 193     // RateLimitClient implementation | 191     // RateLimitClient implementation | 
| 194     virtual void rateLimit() OVERRIDE; | 192     virtual void rateLimit() OVERRIDE; | 
| 195 | 193 | 
| 196     bool bufferedUpdates(); | 194     bool bufferedUpdates(); | 
| 197     bool requestPartialTextureUpdate(); | 195     bool requestPartialTextureUpdate(); | 
| 198     void deleteTextureAfterCommit(scoped_ptr<CCPrioritizedTexture>); | 196     void deleteTextureAfterCommit(scoped_ptr<CCPrioritizedTexture>); | 
| 199 | 197 | 
| 200     void setDeviceScaleFactor(float); | 198     void setDeviceScaleFactor(float); | 
| 201     float deviceScaleFactor() const { return m_deviceScaleFactor; } | 199     float deviceScaleFactor() const { return m_deviceScaleFactor; } | 
| 202 | 200 | 
|  | 201     void setShowFPSCounter(bool show); | 
|  | 202     bool hasFontAtlas() const; | 
| 203     void setFontAtlas(scoped_ptr<CCFontAtlas>); | 203     void setFontAtlas(scoped_ptr<CCFontAtlas>); | 
| 204 | 204 | 
| 205     HeadsUpDisplayLayerChromium* hudLayer() const { return m_hudLayer.get(); } | 205     HeadsUpDisplayLayerChromium* hudLayer() const { return m_hudLayer.get(); } | 
| 206 | 206 | 
| 207 protected: | 207 protected: | 
| 208     CCLayerTreeHost(CCLayerTreeHostClient*, const CCLayerTreeSettings&); | 208     CCLayerTreeHost(CCLayerTreeHostClient*, const CCLayerTreeSettings&); | 
| 209     bool initialize(); | 209     bool initialize(); | 
| 210 | 210 | 
| 211 private: | 211 private: | 
| 212     typedef std::vector<scoped_refptr<LayerChromium> > LayerList; | 212     typedef std::vector<scoped_refptr<LayerChromium> > LayerList; | 
| 213 | 213 | 
| 214     void initializeRenderer(); | 214     void initializeRenderer(); | 
| 215 | 215 | 
| 216     void update(LayerChromium*, CCTextureUpdateQueue&, const CCOcclusionTracker*
     ); | 216     void update(LayerChromium*, CCTextureUpdateQueue&, const CCOcclusionTracker*
     ); | 
| 217     bool paintLayerContents(const LayerList&, CCTextureUpdateQueue&); | 217     bool paintLayerContents(const LayerList&, CCTextureUpdateQueue&); | 
| 218     bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdateQueue&); | 218     bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdateQueue&); | 
| 219 | 219 | 
| 220     void updateLayers(LayerChromium*, CCTextureUpdateQueue&); | 220     void updateLayers(LayerChromium*, CCTextureUpdateQueue&); | 
| 221 | 221 | 
| 222     void prioritizeTextures(const LayerList&, CCOverdrawMetrics&); | 222     void prioritizeTextures(const LayerList&, CCOverdrawMetrics&); | 
| 223     void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 223     void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 
| 224     void setPrioritiesForLayers(const LayerList&); | 224     void setPrioritiesForLayers(const LayerList&); | 
| 225     size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 225     size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 
| 226 | 226 | 
| 227     void animateLayers(double monotonicTime); | 227     void animateLayers(double monotonicTime); | 
| 228     bool animateLayersRecursive(LayerChromium* current, double monotonicTime); | 228     bool animateLayersRecursive(LayerChromium* current, double monotonicTime); | 
| 229     void setAnimationEventsRecursive(const CCAnimationEventsVector&, LayerChromi
     um*, double wallClockTime); | 229     void setAnimationEventsRecursive(const CCAnimationEventsVector&, LayerChromi
     um*, double wallClockTime); | 
| 230 | 230 | 
|  | 231     void createHUDLayerIfNeeded(); | 
|  | 232 | 
| 231     bool m_animating; | 233     bool m_animating; | 
| 232     bool m_needsAnimateLayers; | 234     bool m_needsAnimateLayers; | 
| 233 | 235 | 
| 234     CCLayerTreeHostClient* m_client; | 236     CCLayerTreeHostClient* m_client; | 
| 235 | 237 | 
| 236     int m_commitNumber; | 238     int m_commitNumber; | 
| 237     CCRenderingStats m_renderingStats; | 239     CCRenderingStats m_renderingStats; | 
| 238 | 240 | 
| 239     scoped_ptr<CCProxy> m_proxy; | 241     scoped_ptr<CCProxy> m_proxy; | 
| 240     bool m_rendererInitialized; | 242     bool m_rendererInitialized; | 
| 241     bool m_contextLost; | 243     bool m_contextLost; | 
| 242     int m_numTimesRecreateShouldFail; | 244     int m_numTimesRecreateShouldFail; | 
| 243     int m_numFailedRecreateAttempts; | 245     int m_numFailedRecreateAttempts; | 
| 244 | 246 | 
| 245     scoped_refptr<LayerChromium> m_rootLayer; | 247     scoped_refptr<LayerChromium> m_rootLayer; | 
| 246     scoped_refptr<HeadsUpDisplayLayerChromium> m_hudLayer; | 248     scoped_refptr<HeadsUpDisplayLayerChromium> m_hudLayer; | 
| 247     scoped_ptr<CCFontAtlas> m_fontAtlas; |  | 
| 248 | 249 | 
| 249     scoped_ptr<CCPrioritizedTextureManager> m_contentsTextureManager; | 250     scoped_ptr<CCPrioritizedTextureManager> m_contentsTextureManager; | 
| 250     scoped_ptr<CCPrioritizedTexture> m_surfaceMemoryPlaceholder; | 251     scoped_ptr<CCPrioritizedTexture> m_surfaceMemoryPlaceholder; | 
| 251 | 252 | 
| 252     CCLayerTreeSettings m_settings; | 253     CCLayerTreeSettings m_settings; | 
| 253 | 254 | 
| 254     IntSize m_layoutViewportSize; | 255     IntSize m_layoutViewportSize; | 
| 255     IntSize m_deviceViewportSize; | 256     IntSize m_deviceViewportSize; | 
| 256     float m_deviceScaleFactor; | 257     float m_deviceScaleFactor; | 
| 257 | 258 | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 273     size_t m_partialTextureUpdateRequests; | 274     size_t m_partialTextureUpdateRequests; | 
| 274 | 275 | 
| 275     static bool s_needsFilterContext; | 276     static bool s_needsFilterContext; | 
| 276 | 277 | 
| 277     DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHost); | 278     DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHost); | 
| 278 }; | 279 }; | 
| 279 | 280 | 
| 280 }  // namespace cc | 281 }  // namespace cc | 
| 281 | 282 | 
| 282 #endif | 283 #endif | 
| OLD | NEW | 
|---|