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

Side by Side Diff: cc/layer_tree_host.h

Issue 11189037: toggle FPS counter in compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: plumbing 'showFPSCounter' through HUD, added 'createHUDLayerIfNeeded' Created 8 years, 2 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
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 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
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(); }
danakj 2012/10/23 15:19:53 Can we keep this and just remove showFPSCounter fr
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
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);
203 void setFontAtlas(scoped_ptr<CCFontAtlas>); 202 void setFontAtlas(scoped_ptr<CCFontAtlas>);
204 203
205 HeadsUpDisplayLayerChromium* hudLayer() const { return m_hudLayer.get(); } 204 HeadsUpDisplayLayerChromium* hudLayer() const { return m_hudLayer.get(); }
206 205
207 protected: 206 protected:
208 CCLayerTreeHost(CCLayerTreeHostClient*, const CCLayerTreeSettings&); 207 CCLayerTreeHost(CCLayerTreeHostClient*, const CCLayerTreeSettings&);
209 bool initialize(); 208 bool initialize();
210 209
211 private: 210 private:
212 typedef std::vector<scoped_refptr<LayerChromium> > LayerList; 211 typedef std::vector<scoped_refptr<LayerChromium> > LayerList;
213 212
214 void initializeRenderer(); 213 void initializeRenderer();
215 214
216 void update(LayerChromium*, CCTextureUpdateQueue&, const CCOcclusionTracker* ); 215 void update(LayerChromium*, CCTextureUpdateQueue&, const CCOcclusionTracker* );
217 bool paintLayerContents(const LayerList&, CCTextureUpdateQueue&); 216 bool paintLayerContents(const LayerList&, CCTextureUpdateQueue&);
218 bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdateQueue&); 217 bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdateQueue&);
219 218
220 void updateLayers(LayerChromium*, CCTextureUpdateQueue&); 219 void updateLayers(LayerChromium*, CCTextureUpdateQueue&);
221 220
222 void prioritizeTextures(const LayerList&, CCOverdrawMetrics&); 221 void prioritizeTextures(const LayerList&, CCOverdrawMetrics&);
223 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); 222 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes);
224 void setPrioritiesForLayers(const LayerList&); 223 void setPrioritiesForLayers(const LayerList&);
225 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); 224 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList);
226 225
227 void animateLayers(double monotonicTime); 226 void animateLayers(double monotonicTime);
228 bool animateLayersRecursive(LayerChromium* current, double monotonicTime); 227 bool animateLayersRecursive(LayerChromium* current, double monotonicTime);
229 void setAnimationEventsRecursive(const CCAnimationEventsVector&, LayerChromi um*, double wallClockTime); 228 void setAnimationEventsRecursive(const CCAnimationEventsVector&, LayerChromi um*, double wallClockTime);
230 229
230 void createHUDLayerIfNeeded();
231
231 bool m_animating; 232 bool m_animating;
232 bool m_needsAnimateLayers; 233 bool m_needsAnimateLayers;
233 234
234 CCLayerTreeHostClient* m_client; 235 CCLayerTreeHostClient* m_client;
235 236
236 int m_commitNumber; 237 int m_commitNumber;
237 CCRenderingStats m_renderingStats; 238 CCRenderingStats m_renderingStats;
238 239
239 scoped_ptr<CCProxy> m_proxy; 240 scoped_ptr<CCProxy> m_proxy;
240 bool m_rendererInitialized; 241 bool m_rendererInitialized;
241 bool m_contextLost; 242 bool m_contextLost;
242 int m_numTimesRecreateShouldFail; 243 int m_numTimesRecreateShouldFail;
243 int m_numFailedRecreateAttempts; 244 int m_numFailedRecreateAttempts;
244 245
245 scoped_refptr<LayerChromium> m_rootLayer; 246 scoped_refptr<LayerChromium> m_rootLayer;
246 scoped_refptr<HeadsUpDisplayLayerChromium> m_hudLayer; 247 scoped_refptr<HeadsUpDisplayLayerChromium> m_hudLayer;
247 scoped_ptr<CCFontAtlas> m_fontAtlas;
248 248
249 scoped_ptr<CCPrioritizedTextureManager> m_contentsTextureManager; 249 scoped_ptr<CCPrioritizedTextureManager> m_contentsTextureManager;
250 scoped_ptr<CCPrioritizedTexture> m_surfaceMemoryPlaceholder; 250 scoped_ptr<CCPrioritizedTexture> m_surfaceMemoryPlaceholder;
251 251
252 CCLayerTreeSettings m_settings; 252 CCLayerTreeSettings m_settings;
253 253
254 IntSize m_layoutViewportSize; 254 IntSize m_layoutViewportSize;
255 IntSize m_deviceViewportSize; 255 IntSize m_deviceViewportSize;
256 float m_deviceScaleFactor; 256 float m_deviceScaleFactor;
257 257
(...skipping 15 matching lines...) Expand all
273 size_t m_partialTextureUpdateRequests; 273 size_t m_partialTextureUpdateRequests;
274 274
275 static bool s_needsFilterContext; 275 static bool s_needsFilterContext;
276 276
277 DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHost); 277 DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHost);
278 }; 278 };
279 279
280 } // namespace cc 280 } // namespace cc
281 281
282 #endif 282 #endif
OLDNEW
« no previous file with comments | « cc/heads_up_display_layer_impl.cc ('k') | cc/layer_tree_host.cc » ('j') | cc/layer_tree_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698