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

Side by Side Diff: ui/compositor/compositor.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_COMPOSITOR_COMPOSITOR_H_ 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_
6 #define UI_COMPOSITOR_COMPOSITOR_H_ 6 #define UI_COMPOSITOR_COMPOSITOR_H_
7 7
8 #include "base/hash_tables.h" 8 #include "base/hash_tables.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // Draws the scene created by the layer tree and any visual effects. If 203 // Draws the scene created by the layer tree and any visual effects. If
204 // |force_clear| is true, this will cause the compositor to clear before 204 // |force_clear| is true, this will cause the compositor to clear before
205 // compositing. 205 // compositing.
206 void Draw(bool force_clear); 206 void Draw(bool force_clear);
207 207
208 // Where possible, draws are scissored to a damage region calculated from 208 // Where possible, draws are scissored to a damage region calculated from
209 // changes to layer properties. This bypasses that and indicates that 209 // changes to layer properties. This bypasses that and indicates that
210 // the whole frame needs to be drawn. 210 // the whole frame needs to be drawn.
211 void ScheduleFullDraw(); 211 void ScheduleFullDraw();
212 212
213 int64 SetInputNumber(int64 input_number);
214
213 // Reads the region |bounds_in_pixel| of the contents of the last rendered 215 // Reads the region |bounds_in_pixel| of the contents of the last rendered
214 // frame into the given bitmap. 216 // frame into the given bitmap.
215 // Returns false if the pixels could not be read. 217 // Returns false if the pixels could not be read.
216 bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds_in_pixel); 218 bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds_in_pixel);
217 219
218 // Sets the compositor's device scale factor and size. 220 // Sets the compositor's device scale factor and size.
219 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); 221 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel);
220 222
221 // Returns the size of the widget that is being drawn to in pixel coordinates. 223 // Returns the size of the widget that is being drawn to in pixel coordinates.
222 const gfx::Size& size() const { return size_; } 224 const gfx::Size& size() const { return size_; }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 virtual scoped_ptr<cc::OutputSurface> 258 virtual scoped_ptr<cc::OutputSurface>
257 createOutputSurface() OVERRIDE; 259 createOutputSurface() OVERRIDE;
258 virtual void didRecreateOutputSurface(bool success) OVERRIDE; 260 virtual void didRecreateOutputSurface(bool success) OVERRIDE;
259 virtual scoped_ptr<cc::InputHandler> createInputHandler() OVERRIDE; 261 virtual scoped_ptr<cc::InputHandler> createInputHandler() OVERRIDE;
260 virtual void willCommit() OVERRIDE; 262 virtual void willCommit() OVERRIDE;
261 virtual void didCommit() OVERRIDE; 263 virtual void didCommit() OVERRIDE;
262 virtual void didCommitAndDrawFrame() OVERRIDE; 264 virtual void didCommitAndDrawFrame() OVERRIDE;
263 virtual void didCompleteSwapBuffers() OVERRIDE; 265 virtual void didCompleteSwapBuffers() OVERRIDE;
264 virtual void scheduleComposite() OVERRIDE; 266 virtual void scheduleComposite() OVERRIDE;
265 virtual scoped_ptr<cc::FontAtlas> createFontAtlas() OVERRIDE; 267 virtual scoped_ptr<cc::FontAtlas> createFontAtlas() OVERRIDE;
266 268 virtual void onReceivedLatencyInfo(
269 const WebKit::WebLatencyInfoImpl& latencyInfo) OVERRIDE;
267 270
268 int last_started_frame() { return last_started_frame_; } 271 int last_started_frame() { return last_started_frame_; }
269 int last_ended_frame() { return last_ended_frame_; } 272 int last_ended_frame() { return last_ended_frame_; }
270 273
271 bool IsLocked() { return compositor_lock_ != NULL; } 274 bool IsLocked() { return compositor_lock_ != NULL; }
272 275
273 private: 276 private:
274 friend class base::RefCounted<Compositor>; 277 friend class base::RefCounted<Compositor>;
275 friend class CompositorLock; 278 friend class CompositorLock;
276 279
(...skipping 21 matching lines...) Expand all
298 // Used to verify that we have at most one draw swap in flight. 301 // Used to verify that we have at most one draw swap in flight.
299 scoped_ptr<PostedSwapQueue> posted_swaps_; 302 scoped_ptr<PostedSwapQueue> posted_swaps_;
300 303
301 // The device scale factor of the monitor that this compositor is compositing 304 // The device scale factor of the monitor that this compositor is compositing
302 // layers on. 305 // layers on.
303 float device_scale_factor_; 306 float device_scale_factor_;
304 307
305 int last_started_frame_; 308 int last_started_frame_;
306 int last_ended_frame_; 309 int last_ended_frame_;
307 310
311 int64 frame_number_;
312
308 bool disable_schedule_composite_; 313 bool disable_schedule_composite_;
309 314
310 CompositorLock* compositor_lock_; 315 CompositorLock* compositor_lock_;
311 316
312 DISALLOW_COPY_AND_ASSIGN(Compositor); 317 DISALLOW_COPY_AND_ASSIGN(Compositor);
313 }; 318 };
314 319
315 } // namespace ui 320 } // namespace ui
316 321
317 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 322 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« cc/gl_renderer.h ('K') | « ui/aura/root_window.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698