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

Side by Side Diff: ui/compositor/compositor.h

Issue 16304003: Unified OutputSurface::SwapBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 205473 Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/compositor/compositor.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 (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 <string> 8 #include <string>
9 9
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // This is only to be used for test. It allows execution of other tasks on 255 // This is only to be used for test. It allows execution of other tasks on
256 // the current message loop before the current task finishs (there is a 256 // the current message loop before the current task finishs (there is a
257 // potential for re-entrancy). 257 // potential for re-entrancy).
258 class COMPOSITOR_EXPORT DrawWaiterForTest : public ui::CompositorObserver { 258 class COMPOSITOR_EXPORT DrawWaiterForTest : public ui::CompositorObserver {
259 public: 259 public:
260 // Waits for a draw to be issued by the compositor. If the test times out 260 // Waits for a draw to be issued by the compositor. If the test times out
261 // here, there may be a logic error in the compositor code causing it 261 // here, there may be a logic error in the compositor code causing it
262 // not to draw. 262 // not to draw.
263 static void Wait(Compositor* compositor); 263 static void Wait(Compositor* compositor);
264 264
265 // Waits for a commit instead of a draw.
266 static void WaitForCommit(Compositor* compositor);
267
265 private: 268 private:
266 DrawWaiterForTest(); 269 DrawWaiterForTest();
267 virtual ~DrawWaiterForTest(); 270 virtual ~DrawWaiterForTest();
268 271
269 void WaitImpl(Compositor* compositor); 272 void WaitImpl(Compositor* compositor);
270 273
271 // CompositorObserver implementation. 274 // CompositorObserver implementation.
272 virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE; 275 virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE;
273 virtual void OnCompositingStarted(Compositor* compositor, 276 virtual void OnCompositingStarted(Compositor* compositor,
274 base::TimeTicks start_time) OVERRIDE; 277 base::TimeTicks start_time) OVERRIDE;
275 virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE; 278 virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE;
276 virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE; 279 virtual void OnCompositingAborted(Compositor* compositor) OVERRIDE;
277 virtual void OnCompositingLockStateChanged(Compositor* compositor) OVERRIDE; 280 virtual void OnCompositingLockStateChanged(Compositor* compositor) OVERRIDE;
278 virtual void OnUpdateVSyncParameters(Compositor* compositor, 281 virtual void OnUpdateVSyncParameters(Compositor* compositor,
279 base::TimeTicks timebase, 282 base::TimeTicks timebase,
280 base::TimeDelta interval) OVERRIDE; 283 base::TimeDelta interval) OVERRIDE;
281 284
282 scoped_ptr<base::RunLoop> wait_run_loop_; 285 scoped_ptr<base::RunLoop> wait_run_loop_;
283 286
287 bool wait_for_commit_;
288
284 DISALLOW_COPY_AND_ASSIGN(DrawWaiterForTest); 289 DISALLOW_COPY_AND_ASSIGN(DrawWaiterForTest);
285 }; 290 };
286 291
287 // Compositor object to take care of GPU painting. 292 // Compositor object to take care of GPU painting.
288 // A Browser compositor object is responsible for generating the final 293 // A Browser compositor object is responsible for generating the final
289 // displayable form of pixels comprising a single widget's contents. It draws an 294 // displayable form of pixels comprising a single widget's contents. It draws an
290 // appropriately transformed texture for each transformed view in the widget's 295 // appropriately transformed texture for each transformed view in the widget's
291 // view hierarchy. 296 // view hierarchy.
292 class COMPOSITOR_EXPORT Compositor 297 class COMPOSITOR_EXPORT Compositor
293 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient), 298 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient),
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 bool disable_schedule_composite_; 453 bool disable_schedule_composite_;
449 454
450 CompositorLock* compositor_lock_; 455 CompositorLock* compositor_lock_;
451 456
452 DISALLOW_COPY_AND_ASSIGN(Compositor); 457 DISALLOW_COPY_AND_ASSIGN(Compositor);
453 }; 458 };
454 459
455 } // namespace ui 460 } // namespace ui
456 461
457 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 462 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698