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

Unified Diff: cc/test/fake_output_surface.cc

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: dana's comments Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: cc/test/fake_output_surface.cc
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index 920b68940c7aea80b23534c60436050206a5b537..341c5f522a6c22c9febc2490db301e3850cc37a6 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -63,6 +63,12 @@ FakeOutputSurface::FakeOutputSurface(
FakeOutputSurface::~FakeOutputSurface() {}
void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) {
+ // In unit tests we sometimes lose the context synchronously during a draw,
+ // so we abort the swap here if that's the case. Real implementations of
+ // OutputSurface should DCHECK that is_lost_ is false.
+ if (is_lost_)
brianderson 2014/04/12 00:09:58 I decided to DCHECK for all other OutputSurface im
danakj 2014/04/14 18:14:51 Hm, there's no point in a unit test that can't hap
brianderson 2014/04/16 22:41:53 I'm going to remove the is_lost_ checks.
+ return;
+
if (frame->software_frame_data || frame->delegated_frame_data ||
!context_provider()) {
frame->AssignTo(&last_sent_frame_);

Powered by Google App Engine
This is Rietveld 408576698