OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |