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

Unified Diff: components/exo/surface.cc

Issue 2485473003: Remove SurfaceFactory::Create and SurfaceFactory::Destroy (Closed)
Patch Set: fixed windows compile error 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
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index 76e1564ab97c5c4259f5639126e25058535f8af6..1dd77b8e224084f0de6e02c56e15372b671d1ed7 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -244,12 +244,10 @@ Surface::~Surface() {
frame_callbacks_);
for (const auto& frame_callback : active_frame_callbacks_)
frame_callback.Run(base::TimeTicks());
-
if (begin_frame_source_ && needs_begin_frame_)
begin_frame_source_->RemoveObserver(this);
- if (local_frame_id_.is_valid())
- factory_owner_->surface_factory_->Destroy(local_frame_id_);
+ factory_owner_->surface_factory_->EvictSurface();
surface_manager_->UnregisterSurfaceFactoryClient(
factory_owner_->frame_sink_id_);
@@ -478,17 +476,10 @@ void Surface::CommitSurfaceHierarchy() {
if (needs_commit_to_new_surface_ || !local_frame_id_.is_valid()) {
needs_commit_to_new_surface_ = false;
local_frame_id_ = factory_owner_->id_allocator_->GenerateId();
- factory_owner_->surface_factory_->Create(local_frame_id_);
}
UpdateSurface(true);
- if (old_local_frame_id.is_valid() && old_local_frame_id != local_frame_id_) {
- factory_owner_->surface_factory_->SetPreviousFrameSurface(
- local_frame_id_, old_local_frame_id);
- factory_owner_->surface_factory_->Destroy(old_local_frame_id);
- }
-
if (old_local_frame_id != local_frame_id_) {
float contents_surface_to_layer_scale = 1.0;
// The bounds must be updated before switching to the new surface, because

Powered by Google App Engine
This is Rietveld 408576698