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

Side by Side Diff: cc/layer_tree_host.h

Issue 11414017: cc: handling debug settings in new LayerTreeDebugState structure (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixing tests Created 8 years 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 CC_LAYER_TREE_HOST_H_ 5 #ifndef CC_LAYER_TREE_HOST_H_
6 #define CC_LAYER_TREE_HOST_H_ 6 #define CC_LAYER_TREE_HOST_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class FontAtlas; 43 class FontAtlas;
44 class Layer; 44 class Layer;
45 class LayerTreeHostImpl; 45 class LayerTreeHostImpl;
46 class LayerTreeHostImplClient; 46 class LayerTreeHostImplClient;
47 class PrioritizedResourceManager; 47 class PrioritizedResourceManager;
48 class ResourceUpdateQueue; 48 class ResourceUpdateQueue;
49 class HeadsUpDisplayLayer; 49 class HeadsUpDisplayLayer;
50 class Region; 50 class Region;
51 struct ScrollAndScaleSet; 51 struct ScrollAndScaleSet;
52 52
53 struct CC_EXPORT LayerTreeSettings { 53 struct CC_EXPORT LayerTreeDebugState {
54 LayerTreeSettings(); 54 LayerTreeDebugState();
55 ~LayerTreeSettings(); 55 ~LayerTreeDebugState();
56 56
57 bool acceleratePainting; 57 bool showFPSCounter;
58 bool showPlatformLayerTree;
58 bool showDebugBorders; 59 bool showDebugBorders;
59 bool showPlatformLayerTree; 60
60 bool showPaintRects; 61 bool showPaintRects;
61 bool showPropertyChangedRects; 62 bool showPropertyChangedRects;
62 bool showSurfaceDamageRects; 63 bool showSurfaceDamageRects;
63 bool showScreenSpaceRects; 64 bool showScreenSpaceRects;
64 bool showReplicaScreenSpaceRects; 65 bool showReplicaScreenSpaceRects;
65 bool showOccludingRects; 66 bool showOccludingRects;
66 bool showNonOccludingRects; 67 bool showNonOccludingRects;
68
69 bool showHudInfo() const;
70 bool showHudRects() const;
71
72 static bool equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b );
73 static LayerTreeDebugState merge(const LayerTreeDebugState& a, const LayerTr eeDebugState& b);
74 };
75
76 struct CC_EXPORT LayerTreeSettings {
77 LayerTreeSettings();
78 ~LayerTreeSettings();
79
80 bool acceleratePainting;
67 bool renderVSyncEnabled; 81 bool renderVSyncEnabled;
68 bool perTilePaintingEnabled; 82 bool perTilePaintingEnabled;
69 bool partialSwapEnabled; 83 bool partialSwapEnabled;
70 bool acceleratedAnimationEnabled; 84 bool acceleratedAnimationEnabled;
71 bool pageScalePinchZoomEnabled; 85 bool pageScalePinchZoomEnabled;
72 bool backgroundColorInsteadOfCheckerboard; 86 bool backgroundColorInsteadOfCheckerboard;
73 bool showOverdrawInTracing; 87 bool showOverdrawInTracing;
74 double refreshRate; 88 double refreshRate;
75 size_t maxPartialTextureUpdates; 89 size_t maxPartialTextureUpdates;
76 gfx::Size defaultTileSize; 90 gfx::Size defaultTileSize;
77 gfx::Size maxUntiledLayerSize; 91 gfx::Size maxUntiledLayerSize;
78 gfx::Size minimumOcclusionTrackingSize; 92 gfx::Size minimumOcclusionTrackingSize;
79 93
80 bool showDebugInfo() const { return showPlatformLayerTree || showDebugRects( ); } 94 LayerTreeDebugState initialDebugState;
81 bool showDebugRects() const { return showPaintRects || showPropertyChangedRe cts || showSurfaceDamageRects || showScreenSpaceRects || showReplicaScreenSpaceR ects || showOccludingRects || showNonOccludingRects; }
82 }; 95 };
83 96
84 // Provides information on an Impl's rendering capabilities back to the LayerTre eHost 97 // Provides information on an Impl's rendering capabilities back to the LayerTre eHost
85 struct CC_EXPORT RendererCapabilities { 98 struct CC_EXPORT RendererCapabilities {
86 RendererCapabilities(); 99 RendererCapabilities();
87 ~RendererCapabilities(); 100 ~RendererCapabilities();
88 101
89 GLenum bestTextureFormat; 102 GLenum bestTextureFormat;
90 bool contextHasCachedFrontBuffer; 103 bool contextHasCachedFrontBuffer;
91 bool usingPartialSwap; 104 bool usingPartialSwap;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 188
176 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl ockTime); 189 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl ockTime);
177 virtual void didAddAnimation(); 190 virtual void didAddAnimation();
178 191
179 Layer* rootLayer() { return m_rootLayer.get(); } 192 Layer* rootLayer() { return m_rootLayer.get(); }
180 const Layer* rootLayer() const { return m_rootLayer.get(); } 193 const Layer* rootLayer() const { return m_rootLayer.get(); }
181 void setRootLayer(scoped_refptr<Layer>); 194 void setRootLayer(scoped_refptr<Layer>);
182 195
183 const LayerTreeSettings& settings() const { return m_settings; } 196 const LayerTreeSettings& settings() const { return m_settings; }
184 197
198 void setDebugState(const LayerTreeDebugState& debugState);
199 const LayerTreeDebugState& debugState() const { return m_debugState; }
200
185 void setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& d eviceViewportSize); 201 void setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& d eviceViewportSize);
186 202
187 const gfx::Size& layoutViewportSize() const { return m_layoutViewportSize; } 203 const gfx::Size& layoutViewportSize() const { return m_layoutViewportSize; }
188 const gfx::Size& deviceViewportSize() const { return m_deviceViewportSize; } 204 const gfx::Size& deviceViewportSize() const { return m_deviceViewportSize; }
189 205
190 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa ctor, float maxPageScaleFactor); 206 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa ctor, float maxPageScaleFactor);
191 207
192 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } 208 void setBackgroundColor(SkColor color) { m_backgroundColor = color; }
193 209
194 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro und = transparent; } 210 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro und = transparent; }
(...skipping 18 matching lines...) Expand all
213 229
214 // RateLimitClient implementation 230 // RateLimitClient implementation
215 virtual void rateLimit() OVERRIDE; 231 virtual void rateLimit() OVERRIDE;
216 232
217 bool bufferedUpdates(); 233 bool bufferedUpdates();
218 bool requestPartialTextureUpdate(); 234 bool requestPartialTextureUpdate();
219 235
220 void setDeviceScaleFactor(float); 236 void setDeviceScaleFactor(float);
221 float deviceScaleFactor() const { return m_deviceScaleFactor; } 237 float deviceScaleFactor() const { return m_deviceScaleFactor; }
222 238
223 void setShowFPSCounter(bool show);
224 void setFontAtlas(scoped_ptr<FontAtlas>); 239 void setFontAtlas(scoped_ptr<FontAtlas>);
225 240
226 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } 241 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); }
227 242
228 Proxy* proxy() const { return m_proxy.get(); } 243 Proxy* proxy() const { return m_proxy.get(); }
229 244
230 protected: 245 protected:
231 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); 246 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&);
232 bool initialize(scoped_ptr<Thread> implThread); 247 bool initialize(scoped_ptr<Thread> implThread);
233 248
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 int m_numTimesRecreateShouldFail; 285 int m_numTimesRecreateShouldFail;
271 int m_numFailedRecreateAttempts; 286 int m_numFailedRecreateAttempts;
272 287
273 scoped_refptr<Layer> m_rootLayer; 288 scoped_refptr<Layer> m_rootLayer;
274 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; 289 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer;
275 290
276 scoped_ptr<PrioritizedResourceManager> m_contentsTextureManager; 291 scoped_ptr<PrioritizedResourceManager> m_contentsTextureManager;
277 scoped_ptr<PrioritizedResource> m_surfaceMemoryPlaceholder; 292 scoped_ptr<PrioritizedResource> m_surfaceMemoryPlaceholder;
278 293
279 LayerTreeSettings m_settings; 294 LayerTreeSettings m_settings;
295 LayerTreeDebugState m_debugState;
280 296
281 gfx::Size m_layoutViewportSize; 297 gfx::Size m_layoutViewportSize;
282 gfx::Size m_deviceViewportSize; 298 gfx::Size m_deviceViewportSize;
283 float m_deviceScaleFactor; 299 float m_deviceScaleFactor;
284 300
285 bool m_visible; 301 bool m_visible;
286 302
287 typedef base::hash_map<WebKit::WebGraphicsContext3D*, scoped_refptr<RateLimi ter> > RateLimiterMap; 303 typedef base::hash_map<WebKit::WebGraphicsContext3D*, scoped_refptr<RateLimi ter> > RateLimiterMap;
288 RateLimiterMap m_rateLimiters; 304 RateLimiterMap m_rateLimiters;
289 305
290 float m_pageScaleFactor; 306 float m_pageScaleFactor;
291 float m_minPageScaleFactor, m_maxPageScaleFactor; 307 float m_minPageScaleFactor, m_maxPageScaleFactor;
292 gfx::Transform m_implTransform; 308 gfx::Transform m_implTransform;
293 bool m_triggerIdleUpdates; 309 bool m_triggerIdleUpdates;
294 310
295 SkColor m_backgroundColor; 311 SkColor m_backgroundColor;
296 bool m_hasTransparentBackground; 312 bool m_hasTransparentBackground;
297 313
298 typedef ScopedPtrVector<PrioritizedResource> TextureList; 314 typedef ScopedPtrVector<PrioritizedResource> TextureList;
299 size_t m_partialTextureUpdateRequests; 315 size_t m_partialTextureUpdateRequests;
300 316
301 static bool s_needsFilterContext; 317 static bool s_needsFilterContext;
302 318
303 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 319 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
304 }; 320 };
305 321
306 } // namespace cc 322 } // namespace cc
307 323
308 #endif // CC_LAYER_TREE_HOST_H_ 324 #endif // CC_LAYER_TREE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698