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

Unified Diff: cc/surfaces/display.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 11 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/surfaces/display.h ('k') | cc/surfaces/surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display.cc
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index 763b81c070054838c1554a0f03b47970f1867aa9..72c31b5248c100b7216e746dcae353bbfc4b820a 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -42,6 +42,13 @@ Display::Display(DisplayClient* client,
Display::~Display() {
manager_->RemoveObserver(this);
+ if (aggregator_) {
+ for (const auto& id_entry : aggregator_->previous_contained_surfaces()) {
+ Surface* surface = manager_->GetSurfaceForId(id_entry.first);
+ if (surface)
+ surface->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED);
+ }
+ }
}
bool Display::Initialize(scoped_ptr<OutputSurface> output_surface) {
@@ -123,7 +130,7 @@ bool Display::Draw() {
for (const auto& id_entry : aggregator_->previous_contained_surfaces()) {
Surface* surface = manager_->GetSurfaceForId(id_entry.first);
if (surface)
- surface->RunDrawCallbacks();
+ surface->RunDrawCallbacks(SurfaceDrawStatus::DRAWN);
}
DelegatedFrameData* frame_data = frame->delegated_frame_data.get();
@@ -168,7 +175,7 @@ void Display::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
client_->SetMemoryPolicy(policy);
}
-void Display::OnSurfaceDamaged(SurfaceId surface_id) {
+void Display::OnSurfaceDamaged(SurfaceId surface_id, bool* changed) {
if (aggregator_ &&
aggregator_->previous_contained_surfaces().count(surface_id)) {
Surface* surface = manager_->GetSurfaceForId(surface_id);
@@ -179,6 +186,10 @@ void Display::OnSurfaceDamaged(SurfaceId surface_id) {
aggregator_->ReleaseResources(surface_id);
}
client_->DisplayDamaged();
+ *changed = true;
+ } else if (surface_id == current_surface_id_) {
+ client_->DisplayDamaged();
+ *changed = true;
}
}
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698