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

Side by Side Diff: cc/surfaces/display_unittest.cc

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: fix clang compile error Created 3 years, 7 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
« no previous file with comments | « cc/surfaces/display_scheduler_unittest.cc ('k') | cc/surfaces/surface.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "cc/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/test/null_task_runner.h" 10 #include "base/test/null_task_runner.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 swapped(false) {} 54 swapped(false) {}
55 55
56 ~TestDisplayScheduler() override {} 56 ~TestDisplayScheduler() override {}
57 57
58 void DisplayResized() override { display_resized_ = true; } 58 void DisplayResized() override { display_resized_ = true; }
59 59
60 void SetNewRootSurface(const SurfaceId& root_surface_id) override { 60 void SetNewRootSurface(const SurfaceId& root_surface_id) override {
61 has_new_root_surface = true; 61 has_new_root_surface = true;
62 } 62 }
63 63
64 void SurfaceDamaged(const SurfaceId& surface_id) override { 64 void SurfaceDamaged(const SurfaceId& surface_id,
65 damaged = true; 65 const BeginFrameAck& ack,
66 needs_draw_ = true; 66 bool display_damaged) override {
67 if (display_damaged) {
68 damaged = true;
69 needs_draw_ = true;
70 }
67 } 71 }
68 72
69 void DidSwapBuffers() override { swapped = true; } 73 void DidSwapBuffers() override { swapped = true; }
70 74
71 void ResetDamageForTest() { 75 void ResetDamageForTest() {
72 damaged = false; 76 damaged = false;
73 display_resized_ = false; 77 display_resized_ = false;
74 has_new_root_surface = false; 78 has_new_root_surface = false;
75 } 79 }
76 80
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 // Verify DidLoseOutputSurface callback is hooked up correctly. 511 // Verify DidLoseOutputSurface callback is hooked up correctly.
508 EXPECT_EQ(0, client.loss_count()); 512 EXPECT_EQ(0, client.loss_count());
509 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM( 513 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM(
510 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB); 514 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB);
511 output_surface_->context_provider()->ContextGL()->Flush(); 515 output_surface_->context_provider()->ContextGL()->Flush();
512 EXPECT_EQ(1, client.loss_count()); 516 EXPECT_EQ(1, client.loss_count());
513 } 517 }
514 518
515 } // namespace 519 } // namespace
516 } // namespace cc 520 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display_scheduler_unittest.cc ('k') | cc/surfaces/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698