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

Unified Diff: components/exo/surface.cc

Issue 2514033002: Introducing SurfaceReferenceFactory (Closed)
Patch Set: fix Created 4 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
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index d2419a5b64bc41a7e3ad84c24a9f16e80ddad2c3..f6764a1f393f4a84d49c8cacbf48536627b3e601 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -141,24 +141,6 @@ class CustomWindowTargeter : public aura::WindowTargeter {
DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter);
};
-void SatisfyCallback(cc::SurfaceManager* manager,
- const cc::SurfaceSequence& sequence) {
- std::vector<uint32_t> sequences;
- sequences.push_back(sequence.sequence);
- manager->DidSatisfySequences(sequence.frame_sink_id, &sequences);
-}
-
-void RequireCallback(cc::SurfaceManager* manager,
- const cc::SurfaceId& id,
- const cc::SurfaceSequence& sequence) {
- cc::Surface* surface = manager->GetSurfaceForId(id);
- if (!surface) {
- LOG(ERROR) << "Attempting to require callback on nonexistent surface";
- return;
- }
- surface->AddDestructionDependency(sequence);
-}
-
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -488,11 +470,10 @@ void Surface::CommitSurfaceHierarchy() {
// mirror layer to update its surface using the latest bounds.
window_->layer()->SetBounds(
gfx::Rect(window_->layer()->bounds().origin(), content_size_));
- window_->layer()->SetShowSurface(
+ cc::SurfaceRefPtr surface_ref = surface_manager_->NewSurfaceRef(
cc::SurfaceId(factory_owner_->frame_sink_id_, local_frame_id_),
- base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)),
- base::Bind(&RequireCallback, base::Unretained(surface_manager_)),
- content_size_, contents_surface_to_layer_scale, content_size_);
+ contents_surface_to_layer_scale, content_size_);
+ window_->layer()->SetShowSurface(std::move(surface_ref), content_size_);
window_->layer()->SetFillsBoundsOpaquely(
state_.blend_mode == SkBlendMode::kSrc ||
state_.opaque_region.contains(

Powered by Google App Engine
This is Rietveld 408576698