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

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

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: track state in DisplayScheduler rather than Surface 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
OLDNEW
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 supports_.clear(); 144 supports_.clear();
145 145
146 damaged_surfaces_.clear(); 146 damaged_surfaces_.clear();
147 } 147 }
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 {}
155 void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) override { 154 void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) override {
156 damaged_surfaces_.insert(surface_id); 155 damaged_surfaces_.insert(surface_id);
157 } 156 }
158 157
159 protected: 158 protected:
160 testing::NiceMock<MockCompositorFrameSinkSupportClient> support_client_; 159 testing::NiceMock<MockCompositorFrameSinkSupportClient> support_client_;
161 160
162 private: 161 private:
163 base::flat_set<SurfaceId> damaged_surfaces_; 162 base::flat_set<SurfaceId> damaged_surfaces_;
164 SurfaceManager surface_manager_; 163 SurfaceManager surface_manager_;
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 DidReceiveCompositorFrameAck(Eq(returned_resources2))); 1380 DidReceiveCompositorFrameAck(Eq(returned_resources2)));
1382 child_support1().SubmitCompositorFrame( 1381 child_support1().SubmitCompositorFrame(
1383 child_id1.local_surface_id(), 1382 child_id1.local_surface_id(),
1384 MakeCompositorFrame(empty_surface_ids(), empty_surface_ids(), 1383 MakeCompositorFrame(empty_surface_ids(), empty_surface_ids(),
1385 {resource2})); 1384 {resource2}));
1386 testing::Mock::VerifyAndClearExpectations(&support_client_); 1385 testing::Mock::VerifyAndClearExpectations(&support_client_);
1387 } 1386 }
1388 1387
1389 } // namespace test 1388 } // namespace test
1390 } // namespace cc 1389 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698