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

Unified Diff: cc/test/fake_surface_observer.cc

Issue 2938833002: Add SurfaceWillDraw notification (Closed)
Patch Set: add unit test to verify that OnSurfaceWillDraw is called only for surfaces added to the CompositorF… 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_surface_observer.h ('k') | components/viz/service/frame_sinks/mojo_frame_sink_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_surface_observer.cc
diff --git a/cc/test/fake_surface_observer.cc b/cc/test/fake_surface_observer.cc
index 0a44e5f8caa46a110de0e93f4a015d46e15f7f58..d5bb3ed7bd6c1318e55ff2a92960ba99362e949e 100644
--- a/cc/test/fake_surface_observer.cc
+++ b/cc/test/fake_surface_observer.cc
@@ -14,6 +14,7 @@ FakeSurfaceObserver::~FakeSurfaceObserver() {}
void FakeSurfaceObserver::Reset() {
last_ack_ = BeginFrameAck();
damaged_surfaces_.clear();
+ will_draw_surfaces_.clear();
last_surface_info_ = SurfaceInfo();
last_created_surface_id_ = SurfaceId();
}
@@ -22,6 +23,11 @@ bool FakeSurfaceObserver::IsSurfaceDamaged(const SurfaceId& surface_id) const {
return damaged_surfaces_.count(surface_id) > 0;
}
+bool FakeSurfaceObserver::SurfaceWillDrawCalled(
+ const SurfaceId& surface_id) const {
+ return will_draw_surfaces_.count(surface_id) > 0;
+}
+
bool FakeSurfaceObserver::OnSurfaceDamaged(const SurfaceId& surface_id,
const BeginFrameAck& ack) {
if (ack.has_damage)
@@ -30,6 +36,10 @@ bool FakeSurfaceObserver::OnSurfaceDamaged(const SurfaceId& surface_id,
return ack.has_damage && damage_display_;
}
+void FakeSurfaceObserver::OnSurfaceWillDraw(const SurfaceId& surface_id) {
+ will_draw_surfaces_.insert(surface_id);
+}
+
void FakeSurfaceObserver::OnSurfaceCreated(const SurfaceInfo& surface_info) {
last_created_surface_id_ = surface_info.id();
last_surface_info_ = surface_info;
« no previous file with comments | « cc/test/fake_surface_observer.h ('k') | components/viz/service/frame_sinks/mojo_frame_sink_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698