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

Side by Side Diff: cc/layer_tree_host.h

Issue 11293121: Add latency measurement system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor input event changes 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 | Annotate | Revision Log
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"
11 #include "base/cancelable_callback.h" 11 #include "base/cancelable_callback.h"
12 #include "base/hash_tables.h" 12 #include "base/hash_tables.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "cc/animation_events.h" 16 #include "cc/animation_events.h"
17 #include "cc/cc_export.h" 17 #include "cc/cc_export.h"
18 #include "cc/layer_tree_host_client.h" 18 #include "cc/layer_tree_host_client.h"
19 #include "cc/layer_tree_host_common.h" 19 #include "cc/layer_tree_host_common.h"
20 #include "cc/layer_tree_settings.h" 20 #include "cc/layer_tree_settings.h"
21 #include "cc/occlusion_tracker.h" 21 #include "cc/occlusion_tracker.h"
22 #include "cc/output_surface.h" 22 #include "cc/output_surface.h"
23 #include "cc/prioritized_resource_manager.h" 23 #include "cc/prioritized_resource_manager.h"
24 #include "cc/proxy.h" 24 #include "cc/proxy.h"
25 #include "cc/rate_limiter.h" 25 #include "cc/rate_limiter.h"
26 #include "cc/rendering_stats.h" 26 #include "cc/rendering_stats.h"
27 #include "cc/scoped_ptr_vector.h" 27 #include "cc/scoped_ptr_vector.h"
28 #include "third_party/skia/include/core/SkColor.h" 28 #include "third_party/skia/include/core/SkColor.h"
29 #include "ui/gfx/rect.h" 29 #include "ui/gfx/rect.h"
30 #include "webkit/compositor_bindings/web_latency_info_impl.h"
30 31
31 #if defined(COMPILER_GCC) 32 #if defined(COMPILER_GCC)
32 namespace BASE_HASH_NAMESPACE { 33 namespace BASE_HASH_NAMESPACE {
33 template<> 34 template<>
34 struct hash<WebKit::WebGraphicsContext3D*> { 35 struct hash<WebKit::WebGraphicsContext3D*> {
35 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { 36 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const {
36 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); 37 return hash<size_t>()(reinterpret_cast<size_t>(ptr));
37 } 38 }
38 }; 39 };
39 } // namespace BASE_HASH_NAMESPACE 40 } // namespace BASE_HASH_NAMESPACE
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 virtual scoped_ptr<LayerTreeHostImpl> createLayerTreeHostImpl(LayerTreeHostI mplClient*); 97 virtual scoped_ptr<LayerTreeHostImpl> createLayerTreeHostImpl(LayerTreeHostI mplClient*);
97 void didLoseOutputSurface(); 98 void didLoseOutputSurface();
98 enum RecreateResult { 99 enum RecreateResult {
99 RecreateSucceeded, 100 RecreateSucceeded,
100 RecreateFailedButTryAgain, 101 RecreateFailedButTryAgain,
101 RecreateFailedAndGaveUp, 102 RecreateFailedAndGaveUp,
102 }; 103 };
103 RecreateResult recreateOutputSurface(); 104 RecreateResult recreateOutputSurface();
104 void didCommitAndDrawFrame() { m_client->didCommitAndDrawFrame(); } 105 void didCommitAndDrawFrame() { m_client->didCommitAndDrawFrame(); }
105 void didCompleteSwapBuffers() { m_client->didCompleteSwapBuffers(); } 106 void didCompleteSwapBuffers() { m_client->didCompleteSwapBuffers(); }
107 void onReceivedLatencyInfo(const WebKit::WebLatencyInfoImpl& latencyInfo) { m_client->onReceivedLatencyInfo(latencyInfo); }
106 void deleteContentsTexturesOnImplThread(ResourceProvider*); 108 void deleteContentsTexturesOnImplThread(ResourceProvider*);
107 virtual void acquireLayerTextures(); 109 virtual void acquireLayerTextures();
108 // Returns false if we should abort this frame due to initialization failure . 110 // Returns false if we should abort this frame due to initialization failure .
109 bool initializeRendererIfNeeded(); 111 bool initializeRendererIfNeeded();
110 void updateLayers(ResourceUpdateQueue&, size_t contentsMemoryLimitBytes); 112 void updateLayers(ResourceUpdateQueue&, size_t contentsMemoryLimitBytes);
111 113
112 LayerTreeHostClient* client() { return m_client; } 114 LayerTreeHostClient* client() { return m_client; }
113 115
114 void composite(); 116 void composite();
115 117
(...skipping 21 matching lines...) Expand all
137 // Test only hook 139 // Test only hook
138 void loseOutputSurface(int numTimes); 140 void loseOutputSurface(int numTimes);
139 141
140 void setNeedsAnimate(); 142 void setNeedsAnimate();
141 // virtual for testing 143 // virtual for testing
142 virtual void setNeedsCommit(); 144 virtual void setNeedsCommit();
143 virtual void setNeedsFullTreeSync(); 145 virtual void setNeedsFullTreeSync();
144 void setNeedsRedraw(); 146 void setNeedsRedraw();
145 bool commitRequested() const; 147 bool commitRequested() const;
146 148
149 void setLatencyInfo(const WebKit::WebLatencyInfoImpl& latency_info);
150
147 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl ockTime); 151 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl ockTime);
148 virtual void didAddAnimation(); 152 virtual void didAddAnimation();
149 153
150 Layer* rootLayer() { return m_rootLayer.get(); } 154 Layer* rootLayer() { return m_rootLayer.get(); }
151 const Layer* rootLayer() const { return m_rootLayer.get(); } 155 const Layer* rootLayer() const { return m_rootLayer.get(); }
152 void setRootLayer(scoped_refptr<Layer>); 156 void setRootLayer(scoped_refptr<Layer>);
153 157
154 const LayerTreeSettings& settings() const { return m_settings; } 158 const LayerTreeSettings& settings() const { return m_settings; }
155 159
156 void setDebugState(const LayerTreeDebugState& debugState); 160 void setDebugState(const LayerTreeDebugState& debugState);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 bool m_triggerIdleUpdates; 270 bool m_triggerIdleUpdates;
267 271
268 SkColor m_backgroundColor; 272 SkColor m_backgroundColor;
269 bool m_hasTransparentBackground; 273 bool m_hasTransparentBackground;
270 274
271 typedef ScopedPtrVector<PrioritizedResource> TextureList; 275 typedef ScopedPtrVector<PrioritizedResource> TextureList;
272 size_t m_partialTextureUpdateRequests; 276 size_t m_partialTextureUpdateRequests;
273 277
274 static bool s_needsFilterContext; 278 static bool s_needsFilterContext;
275 279
280 WebKit::WebLatencyInfoImpl m_latencyInfo;
281
276 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 282 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
277 }; 283 };
278 284
279 } // namespace cc 285 } // namespace cc
280 286
281 #endif // CC_LAYER_TREE_HOST_H_ 287 #endif // CC_LAYER_TREE_HOST_H_
OLDNEW
« cc/gl_renderer.h ('K') | « cc/input_handler.h ('k') | cc/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698