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

Unified Diff: cc/surfaces/surface.cc

Issue 1945533002: Add way to mark other Surface a predecessor for a Surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.cc
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index 173218c2e8e8aa349cdee2cd4a6a371e218355bc..73181292cc176e0253e83de0cde55330f40ed5f7 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -24,6 +24,7 @@ static const int kFrameIndexStart = 2;
Surface::Surface(SurfaceId id, SurfaceFactory* factory)
: surface_id_(id),
+ previous_frame_surface_id_(id),
factory_(factory->AsWeakPtr()),
frame_index_(kFrameIndexStart),
destroyed_(false) {}
@@ -41,6 +42,12 @@ Surface::~Surface() {
draw_callback_.Run(SurfaceDrawStatus::DRAW_SKIPPED);
}
+void Surface::SetPreviousFrameSurface(Surface* surface) {
+ DCHECK(surface);
+ frame_index_ = surface->frame_index() + 1;
+ previous_frame_surface_id_ = surface->surface_id();
+}
+
void Surface::QueueFrame(std::unique_ptr<CompositorFrame> frame,
const DrawCallback& callback) {
DCHECK(factory_);
@@ -64,6 +71,8 @@ void Surface::QueueFrame(std::unique_ptr<CompositorFrame> frame,
!current_frame_->delegated_frame_data->render_pass_list.empty())
++frame_index_;
+ previous_frame_surface_id_ = surface_id();
+
std::vector<SurfaceId> new_referenced_surfaces;
if (current_frame_) {
new_referenced_surfaces = current_frame_->metadata.referenced_surfaces;
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698