| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "base/containers/flat_set.h" | 5 #include "base/containers/flat_set.h" |
| 6 #include "cc/surfaces/compositor_frame_sink_support.h" | 6 #include "cc/surfaces/compositor_frame_sink_support.h" |
| 7 #include "cc/surfaces/surface_id.h" | 7 #include "cc/surfaces/surface_id.h" |
| 8 #include "cc/surfaces/surface_manager.h" | 8 #include "cc/surfaces/surface_manager.h" |
| 9 #include "cc/surfaces/surface_observer.h" | 9 #include "cc/surfaces/surface_observer.h" |
| 10 #include "cc/test/begin_frame_args_test.h" | 10 #include "cc/test/begin_frame_args_test.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 bool IsSurfaceDamaged(const SurfaceId& surface_id) const { | 149 bool IsSurfaceDamaged(const SurfaceId& surface_id) const { |
| 150 return damaged_surfaces_.count(surface_id) > 0; | 150 return damaged_surfaces_.count(surface_id) > 0; |
| 151 } | 151 } |
| 152 | 152 |
| 153 // SurfaceObserver implementation: | 153 // SurfaceObserver implementation: |
| 154 void OnSurfaceCreated(const SurfaceInfo& surface_info) override {} | 154 void OnSurfaceCreated(const SurfaceInfo& surface_info) override {} |
| 155 void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) override { | 155 void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) override { |
| 156 damaged_surfaces_.insert(surface_id); | 156 damaged_surfaces_.insert(surface_id); |
| 157 } | 157 } |
| 158 void OnSurfaceDiscarded(const SurfaceId& surface_id) override {} |
| 158 | 159 |
| 159 protected: | 160 protected: |
| 160 testing::NiceMock<MockCompositorFrameSinkSupportClient> support_client_; | 161 testing::NiceMock<MockCompositorFrameSinkSupportClient> support_client_; |
| 161 | 162 |
| 162 private: | 163 private: |
| 163 base::flat_set<SurfaceId> damaged_surfaces_; | 164 base::flat_set<SurfaceId> damaged_surfaces_; |
| 164 SurfaceManager surface_manager_; | 165 SurfaceManager surface_manager_; |
| 165 std::unique_ptr<FakeExternalBeginFrameSource> begin_frame_source_; | 166 std::unique_ptr<FakeExternalBeginFrameSource> begin_frame_source_; |
| 166 std::vector<std::unique_ptr<CompositorFrameSinkSupport>> supports_; | 167 std::vector<std::unique_ptr<CompositorFrameSinkSupport>> supports_; |
| 167 | 168 |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 DidReceiveCompositorFrameAck(Eq(returned_resources2))); | 1382 DidReceiveCompositorFrameAck(Eq(returned_resources2))); |
| 1382 child_support1().SubmitCompositorFrame( | 1383 child_support1().SubmitCompositorFrame( |
| 1383 child_id1.local_surface_id(), | 1384 child_id1.local_surface_id(), |
| 1384 MakeCompositorFrame(empty_surface_ids(), empty_surface_ids(), | 1385 MakeCompositorFrame(empty_surface_ids(), empty_surface_ids(), |
| 1385 {resource2})); | 1386 {resource2})); |
| 1386 testing::Mock::VerifyAndClearExpectations(&support_client_); | 1387 testing::Mock::VerifyAndClearExpectations(&support_client_); |
| 1387 } | 1388 } |
| 1388 | 1389 |
| 1389 } // namespace test | 1390 } // namespace test |
| 1390 } // namespace cc | 1391 } // namespace cc |
| OLD | NEW |