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

Side by Side Diff: cc/test/fake_surface_observer.cc

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: fix clang compile error Created 3 years, 6 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/test/fake_surface_observer.h ('k') | components/viz/frame_sinks/mojo_frame_sink_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/test/fake_surface_observer.h"
6
7 namespace cc {
8
9 FakeSurfaceObserver::FakeSurfaceObserver(bool damage_display)
10 : damage_display_(damage_display) {}
11
12 FakeSurfaceObserver::~FakeSurfaceObserver() {}
13
14 void FakeSurfaceObserver::Reset() {
15 last_ack_ = BeginFrameAck();
16 damaged_surfaces_.clear();
17 last_surface_info_ = SurfaceInfo();
18 last_created_surface_id_ = SurfaceId();
19 }
20
21 bool FakeSurfaceObserver::IsSurfaceDamaged(const SurfaceId& surface_id) const {
22 return damaged_surfaces_.count(surface_id) > 0;
23 }
24
25 void FakeSurfaceObserver::OnSurfaceDamaged(const SurfaceId& surface_id,
26 const BeginFrameAck& ack,
27 bool* changed) {
28 if (ack.has_damage)
29 damaged_surfaces_.insert(surface_id);
30 last_ack_ = ack;
31 if (damage_display_)
32 *changed = true;
33 }
34
35 void FakeSurfaceObserver::OnSurfaceCreated(const SurfaceInfo& surface_info) {
36 last_created_surface_id_ = surface_info.id();
37 last_surface_info_ = surface_info;
38 }
39
40 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_surface_observer.h ('k') | components/viz/frame_sinks/mojo_frame_sink_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698