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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit Created 4 years, 1 month 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_factory.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index 3e3ace3135189b5edc4a68869c8ba1a7fe1b048c..9182fc1ee490120906caf9fc12001e25967ece76 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -85,18 +85,14 @@ void SurfaceFactory::SubmitCompositorFrame(const LocalFrameId& local_frame_id,
OwningSurfaceMap::iterator it = surface_map_.find(local_frame_id);
DCHECK(it != surface_map_.end());
DCHECK(it->second->factory().get() == this);
- const CompositorFrame& previous_frame = it->second->GetEligibleFrame();
// Tell the SurfaceManager if this is the first frame submitted with this
// LocalFrameId.
- if (!previous_frame.delegated_frame_data) {
+ if (!it->second->HasFrame()) {
float device_scale_factor = frame.metadata.device_scale_factor;
gfx::Size frame_size;
// CompositorFrames may not be populated with a RenderPass in unit tests.
- if (frame.delegated_frame_data &&
- !frame.delegated_frame_data->render_pass_list.empty()) {
- frame_size =
- frame.delegated_frame_data->render_pass_list[0]->output_rect.size();
- }
+ if (!frame.render_pass_list.empty())
+ frame_size = frame.render_pass_list[0]->output_rect.size();
manager_->SurfaceCreated(it->second->surface_id(), frame_size,
device_scale_factor);
}
@@ -120,6 +116,14 @@ void SurfaceFactory::RequestCopyOfSurface(
manager_->SurfaceModified(SurfaceId(frame_sink_id_, local_frame_id));
}
+void SurfaceFactory::ClearSurface(const LocalFrameId& local_frame_id) {
+ OwningSurfaceMap::iterator it = surface_map_.find(local_frame_id);
+ DCHECK(it != surface_map_.end());
+ DCHECK(it->second->factory().get() == this);
+ it->second->EvictFrame();
+ manager_->SurfaceModified(SurfaceId(frame_sink_id_, local_frame_id));
+}
+
void SurfaceFactory::WillDrawSurface(const LocalFrameId& id,
const gfx::Rect& damage_rect) {
client_->WillDrawSurface(id, damage_rect);
« no previous file with comments | « cc/surfaces/surface_factory.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698