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

Unified Diff: cc/surfaces/display.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/scheduler/scheduler_state_machine_unittest.cc ('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 9257446a2eb8e96f793beb6a93467ff0b355e06a..8833037c5ecbd822fc554b6697657c59b474739e 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -118,6 +118,13 @@ bool Display::Draw() {
TRACE_EVENT0("cc", "Display::Draw");
benchmark_instrumentation::IssueDisplayRenderingStatsEvent();
+
+ // Run callbacks early to allow pipelining.
+ for (const auto& id_entry : aggregator_->previous_contained_surfaces()) {
+ Surface* surface = manager_->GetSurfaceForId(id_entry.first);
+ if (surface)
+ surface->RunDrawCallbacks();
+ }
DelegatedFrameData* frame_data = frame->delegated_frame_data.get();
gfx::Size surface_size =
@@ -134,23 +141,13 @@ bool Display::Draw() {
device_clip_rect,
disable_picture_quad_image_filtering);
- bool disable_swap = surface_size != current_surface_size_;
- if (disable_swap) {
+ if (surface_size != current_surface_size_) {
DidSwapBuffers();
+ DidSwapBuffersComplete();
} else {
renderer_->SwapBuffers(frame->metadata);
}
- for (SurfaceAggregator::SurfaceIndexMap::iterator it =
- aggregator_->previous_contained_surfaces().begin();
- it != aggregator_->previous_contained_surfaces().end();
- ++it) {
- Surface* surface = manager_->GetSurfaceForId(it->first);
- if (surface)
- surface->RunDrawCallbacks();
- }
- if (disable_swap)
- DidSwapBuffersComplete();
return true;
}
@@ -172,8 +169,11 @@ void Display::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
}
void Display::OnSurfaceDamaged(SurfaceId surface) {
- if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface))
+ if (aggregator_ &&
+ aggregator_->previous_contained_surfaces().count(surface)) {
+ aggregator_->ReleaseResources(surface);
client_->DisplayDamaged();
+ }
}
SurfaceId Display::CurrentSurfaceId() {
« no previous file with comments | « cc/scheduler/scheduler_state_machine_unittest.cc ('k') | cc/surfaces/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698