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

Side by Side Diff: cc/layer_tree_host_impl.h

Issue 11191068: Remove WTF::currentTime() / WTF::monotonicallyIncreasingTime() uses from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CCLayerTreeHostImpl_h 5 #ifndef CCLayerTreeHostImpl_h
6 #define CCLayerTreeHostImpl_h 6 #define CCLayerTreeHostImpl_h
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 18 matching lines...) Expand all
29 class RenderPassDrawQuad; 29 class RenderPassDrawQuad;
30 class ResourceProvider; 30 class ResourceProvider;
31 struct RendererCapabilities; 31 struct RendererCapabilities;
32 struct RenderingStats; 32 struct RenderingStats;
33 33
34 // LayerTreeHost->Proxy callback interface. 34 // LayerTreeHost->Proxy callback interface.
35 class LayerTreeHostImplClient { 35 class LayerTreeHostImplClient {
36 public: 36 public:
37 virtual void didLoseContextOnImplThread() = 0; 37 virtual void didLoseContextOnImplThread() = 0;
38 virtual void onSwapBuffersCompleteOnImplThread() = 0; 38 virtual void onSwapBuffersCompleteOnImplThread() = 0;
39 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter valInSeconds) = 0; 39 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe lta interval) = 0;
40 virtual void onCanDrawStateChanged(bool canDraw) = 0; 40 virtual void onCanDrawStateChanged(bool canDraw) = 0;
41 virtual void setNeedsRedrawOnImplThread() = 0; 41 virtual void setNeedsRedrawOnImplThread() = 0;
42 virtual void setNeedsCommitOnImplThread() = 0; 42 virtual void setNeedsCommitOnImplThread() = 0;
43 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio nEventsVector>, double wallClockTime) = 0; 43 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio nEventsVector>, base::Time wallClockTime) = 0;
44 // Returns true if resources were deleted by this call. 44 // Returns true if resources were deleted by this call.
45 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) = 0; 45 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) = 0;
46 virtual void sendManagedMemoryStats() = 0; 46 virtual void sendManagedMemoryStats() = 0;
47 }; 47 };
48 48
49 // PinchZoomViewport models the bounds and offset of the viewport that is used d uring a pinch-zoom operation. 49 // PinchZoomViewport models the bounds and offset of the viewport that is used d uring a pinch-zoom operation.
50 // It tracks the layout-space dimensions of the viewport before any applied scal e, and then tracks the layout-space 50 // It tracks the layout-space dimensions of the viewport before any applied scal e, and then tracks the layout-space
51 // coordinates of the viewport respecting the pinch settings. 51 // coordinates of the viewport respecting the pinch settings.
52 class PinchZoomViewport { 52 class PinchZoomViewport {
53 public: 53 public:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT reeHostImplClient*); 107 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT reeHostImplClient*);
108 virtual ~LayerTreeHostImpl(); 108 virtual ~LayerTreeHostImpl();
109 109
110 // InputHandlerClient implementation 110 // InputHandlerClient implementation
111 virtual InputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, InputH andlerClient::ScrollInputType) OVERRIDE; 111 virtual InputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, InputH andlerClient::ScrollInputType) OVERRIDE;
112 virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE; 112 virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE;
113 virtual void scrollEnd() OVERRIDE; 113 virtual void scrollEnd() OVERRIDE;
114 virtual void pinchGestureBegin() OVERRIDE; 114 virtual void pinchGestureBegin() OVERRIDE;
115 virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE; 115 virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE;
116 virtual void pinchGestureEnd() OVERRIDE; 116 virtual void pinchGestureEnd() OVERRIDE;
117 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anc horPoint, float pageScale, double startTime, double duration) OVERRIDE; 117 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anc horPoint, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVERRIDE;
118 virtual void scheduleAnimation() OVERRIDE; 118 virtual void scheduleAnimation() OVERRIDE;
119 119
120 struct FrameData : public RenderPassSink { 120 struct FrameData : public RenderPassSink {
121 FrameData(); 121 FrameData();
122 ~FrameData(); 122 ~FrameData();
123 123
124 std::vector<IntRect> occludingScreenSpaceRects; 124 std::vector<IntRect> occludingScreenSpaceRects;
125 RenderPassList renderPasses; 125 RenderPassList renderPasses;
126 RenderPassIdHashMap renderPassesById; 126 RenderPassIdHashMap renderPassesById;
127 LayerList* renderSurfaceLayerList; 127 LayerList* renderSurfaceLayerList;
128 LayerList willDrawLayers; 128 LayerList willDrawLayers;
129 129
130 // RenderPassSink implementation. 130 // RenderPassSink implementation.
131 virtual void appendRenderPass(scoped_ptr<RenderPass>) OVERRIDE; 131 virtual void appendRenderPass(scoped_ptr<RenderPass>) OVERRIDE;
132 }; 132 };
133 133
134 // Virtual for testing. 134 // Virtual for testing.
135 virtual void beginCommit(); 135 virtual void beginCommit();
136 virtual void commitComplete(); 136 virtual void commitComplete();
137 virtual void animate(double monotonicTime, double wallClockTime); 137 virtual void animate(base::TimeTicks monotonicTime, base::Time wallClockTime );
138 138
139 // Returns false if problems occured preparing the frame, and we should try 139 // Returns false if problems occured preparing the frame, and we should try
140 // to avoid displaying the frame. If prepareToDraw is called, 140 // to avoid displaying the frame. If prepareToDraw is called,
141 // didDrawAllLayers must also be called, regardless of whether drawLayers is 141 // didDrawAllLayers must also be called, regardless of whether drawLayers is
142 // called between the two. 142 // called between the two.
143 virtual bool prepareToDraw(FrameData&); 143 virtual bool prepareToDraw(FrameData&);
144 virtual void drawLayers(const FrameData&); 144 virtual void drawLayers(const FrameData&);
145 // Must be called if and only if prepareToDraw was called. 145 // Must be called if and only if prepareToDraw was called.
146 void didDrawAllLayers(const FrameData&); 146 void didDrawAllLayers(const FrameData&);
147 147
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 float deviceScaleFactor() const { return m_deviceScaleFactor; } 204 float deviceScaleFactor() const { return m_deviceScaleFactor; }
205 void setDeviceScaleFactor(float); 205 void setDeviceScaleFactor(float);
206 206
207 float pageScaleFactor() const; 207 float pageScaleFactor() const;
208 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa ctor, float maxPageScaleFactor); 208 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa ctor, float maxPageScaleFactor);
209 209
210 scoped_ptr<ScrollAndScaleSet> processScrollDeltas(); 210 scoped_ptr<ScrollAndScaleSet> processScrollDeltas();
211 WebKit::WebTransformationMatrix implTransform() const; 211 WebKit::WebTransformationMatrix implTransform() const;
212 212
213 void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor, float scale, double durationSec); 213 void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor, float scale, base::TimeDelta duration);
214 214
215 SkColor backgroundColor() const { return m_backgroundColor; } 215 SkColor backgroundColor() const { return m_backgroundColor; }
216 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } 216 void setBackgroundColor(SkColor color) { m_backgroundColor = color; }
217 217
218 bool hasTransparentBackground() const { return m_hasTransparentBackground; } 218 bool hasTransparentBackground() const { return m_hasTransparentBackground; }
219 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro und = transparent; } 219 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro und = transparent; }
220 220
221 bool needsAnimateLayers() const { return m_needsAnimateLayers; } 221 bool needsAnimateLayers() const { return m_needsAnimateLayers; }
222 void setNeedsAnimateLayers() { m_needsAnimateLayers = true; } 222 void setNeedsAnimateLayers() { m_needsAnimateLayers = true; }
223 223
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 size_t renderPassListEnd(const RenderPassList& list) const { return list .size(); } 257 size_t renderPassListEnd(const RenderPassList& list) const { return list .size(); }
258 size_t renderPassListNext(size_t it) const { return it + 1; } 258 size_t renderPassListNext(size_t it) const { return it + 1; }
259 }; 259 };
260 260
261 template<typename RenderPassCuller> 261 template<typename RenderPassCuller>
262 static void removeRenderPasses(RenderPassCuller, FrameData&); 262 static void removeRenderPasses(RenderPassCuller, FrameData&);
263 263
264 protected: 264 protected:
265 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*); 265 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*);
266 266
267 void animatePageScale(double monotonicTime); 267 void animatePageScale(base::TimeTicks monotonicTime);
268 void animateScrollbars(double monotonicTime); 268 void animateScrollbars(base::TimeTicks monotonicTime);
269 269
270 // Exposed for testing. 270 // Exposed for testing.
271 void calculateRenderSurfaceLayerList(LayerList&); 271 void calculateRenderSurfaceLayerList(LayerList&);
272 272
273 // Virtual for testing. 273 // Virtual for testing.
274 virtual void animateLayers(double monotonicTime, double wallClockTime); 274 virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClo ckTime);
275 275
276 // Virtual for testing. 276 // Virtual for testing.
277 virtual base::TimeDelta lowFrequencyAnimationInterval() const; 277 virtual base::TimeDelta lowFrequencyAnimationInterval() const;
278 278
279 LayerTreeHostImplClient* m_client; 279 LayerTreeHostImplClient* m_client;
280 int m_sourceFrameNumber; 280 int m_sourceFrameNumber;
281 281
282 private: 282 private:
283 void computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo); 283 void computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo);
284 void computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo); 284 void computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo);
285 void makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, const IntSize& scr ollOffset, float pageScale); 285 void makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, const IntSize& scr ollOffset, float pageScale);
286 286
287 void setPageScaleDelta(float); 287 void setPageScaleDelta(float);
288 void updateMaxScrollPosition(); 288 void updateMaxScrollPosition();
289 void trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, const LayerList& re nderSurfaceLayerList); 289 void trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, const LayerList& re nderSurfaceLayerList);
290 290
291 // Returns false if the frame should not be displayed. This function should 291 // Returns false if the frame should not be displayed. This function should
292 // only be called from prepareToDraw, as didDrawAllLayers must be called 292 // only be called from prepareToDraw, as didDrawAllLayers must be called
293 // if this helper function is called. 293 // if this helper function is called.
294 bool calculateRenderPasses(FrameData&); 294 bool calculateRenderPasses(FrameData&);
295 void animateLayersRecursive(LayerImpl*, double monotonicTime, double wallClo ckTime, AnimationEventsVector*, bool& didAnimate, bool& needsAnimateLayers); 295 void animateLayersRecursive(LayerImpl*, base::TimeTicks monotonicTime, base: :Time wallClockTime, AnimationEventsVector*, bool& didAnimate, bool& needsAnimat eLayers);
296 void setBackgroundTickingEnabled(bool); 296 void setBackgroundTickingEnabled(bool);
297 IntSize contentSize() const; 297 IntSize contentSize() const;
298 298
299 void sendDidLoseContextRecursive(LayerImpl*); 299 void sendDidLoseContextRecursive(LayerImpl*);
300 void clearRenderSurfaces(); 300 void clearRenderSurfaces();
301 bool ensureRenderSurfaceLayerList(); 301 bool ensureRenderSurfaceLayerList();
302 void clearCurrentlyScrollingLayer(); 302 void clearCurrentlyScrollingLayer();
303 303
304 void animateScrollbarsRecursive(LayerImpl*, double monotonicTime); 304 void animateScrollbarsRecursive(LayerImpl*, base::TimeTicks monotonicTime);
305 305
306 void dumpRenderSurfaces(std::string*, int indent, const LayerImpl*) const; 306 void dumpRenderSurfaces(std::string*, int indent, const LayerImpl*) const;
307 307
308 scoped_ptr<GraphicsContext> m_context; 308 scoped_ptr<GraphicsContext> m_context;
309 scoped_ptr<ResourceProvider> m_resourceProvider; 309 scoped_ptr<ResourceProvider> m_resourceProvider;
310 scoped_ptr<Renderer> m_renderer; 310 scoped_ptr<Renderer> m_renderer;
311 scoped_ptr<LayerImpl> m_rootLayerImpl; 311 scoped_ptr<LayerImpl> m_rootLayerImpl;
312 LayerImpl* m_rootScrollLayerImpl; 312 LayerImpl* m_rootScrollLayerImpl;
313 LayerImpl* m_currentlyScrollingLayerImpl; 313 LayerImpl* m_currentlyScrollingLayerImpl;
314 HeadsUpDisplayLayerImpl* m_hudLayerImpl; 314 HeadsUpDisplayLayerImpl* m_hudLayerImpl;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 size_t m_numImplThreadScrolls; 349 size_t m_numImplThreadScrolls;
350 size_t m_numMainThreadScrolls; 350 size_t m_numMainThreadScrolls;
351 351
352 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 352 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
353 }; 353 };
354 354
355 } // namespace cc 355 } // namespace cc
356 356
357 #endif 357 #endif
OLDNEW
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698