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

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: removed hasFontAtlas methods, put DCHECKs in HUDLayerImpl 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 TextureUpdateQueue; 45 class TextureUpdateQueue;
46 class HeadsUpDisplayLayer; 46 class HeadsUpDisplayLayer;
47 class Region; 47 class Region;
48 struct ScrollAndScaleSet; 48 struct ScrollAndScaleSet;
49 49
50 struct LayerTreeSettings { 50 struct LayerTreeSettings {
51 LayerTreeSettings(); 51 LayerTreeSettings();
52 ~LayerTreeSettings(); 52 ~LayerTreeSettings();
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 LayerTre eHost 72 // Provides information on an Impl's rendering capabilities back to the LayerTre eHost
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<PrioritizedTexture>); 196 void deleteTextureAfterCommit(scoped_ptr<PrioritizedTexture>);
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<FontAtlas>); 202 void setFontAtlas(scoped_ptr<FontAtlas>);
204 203
205 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } 204 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); }
206 205
207 protected: 206 protected:
208 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); 207 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&);
209 bool initialize(); 208 bool initialize();
210 209
211 private: 210 private:
212 typedef std::vector<scoped_refptr<Layer> > LayerList; 211 typedef std::vector<scoped_refptr<Layer> > LayerList;
213 212
214 void initializeRenderer(); 213 void initializeRenderer();
215 214
216 void update(Layer*, TextureUpdateQueue&, const OcclusionTracker*); 215 void update(Layer*, TextureUpdateQueue&, const OcclusionTracker*);
217 bool paintLayerContents(const LayerList&, TextureUpdateQueue&); 216 bool paintLayerContents(const LayerList&, TextureUpdateQueue&);
218 bool paintMasksForRenderSurface(Layer*, TextureUpdateQueue&); 217 bool paintMasksForRenderSurface(Layer*, TextureUpdateQueue&);
219 218
220 void updateLayers(Layer*, TextureUpdateQueue&); 219 void updateLayers(Layer*, TextureUpdateQueue&);
221 220
222 void prioritizeTextures(const LayerList&, OverdrawMetrics&); 221 void prioritizeTextures(const LayerList&, OverdrawMetrics&);
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(Layer* current, double monotonicTime); 227 bool animateLayersRecursive(Layer* current, double monotonicTime);
229 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, doubl e wallClockTime); 228 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, doubl e 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 LayerTreeHostClient* m_client; 235 LayerTreeHostClient* m_client;
235 236
236 int m_commitNumber; 237 int m_commitNumber;
237 RenderingStats m_renderingStats; 238 RenderingStats m_renderingStats;
238 239
239 scoped_ptr<Proxy> m_proxy; 240 scoped_ptr<Proxy> 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<Layer> m_rootLayer; 246 scoped_refptr<Layer> m_rootLayer;
246 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; 247 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer;
247 scoped_ptr<FontAtlas> m_fontAtlas;
248 248
249 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager; 249 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager;
250 scoped_ptr<PrioritizedTexture> m_surfaceMemoryPlaceholder; 250 scoped_ptr<PrioritizedTexture> m_surfaceMemoryPlaceholder;
251 251
252 LayerTreeSettings m_settings; 252 LayerTreeSettings 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(LayerTreeHost); 277 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
278 }; 278 };
279 279
280 } // namespace cc 280 } // namespace cc
281 281
282 #endif 282 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698