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

Unified Diff: blimp/client/core/compositor/blimp_compositor.cc

Issue 2514033002: Introducing SurfaceReferenceFactory (Closed)
Patch Set: rebase 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
« no previous file with comments | « no previous file | cc/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/compositor/blimp_compositor.cc
diff --git a/blimp/client/core/compositor/blimp_compositor.cc b/blimp/client/core/compositor/blimp_compositor.cc
index a6e3b2506e8cd66bfe47d73518214a98abff6bca..185742c154ff7376fbbc7364ebb689d42d062b69 100644
--- a/blimp/client/core/compositor/blimp_compositor.cc
+++ b/blimp/client/core/compositor/blimp_compositor.cc
@@ -38,30 +38,6 @@
namespace blimp {
namespace client {
-namespace {
-
-void SatisfyCallback(base::WeakPtr<cc::SurfaceManager> manager,
- const cc::SurfaceSequence& sequence) {
- if (!manager)
- return;
- std::vector<uint32_t> sequences;
- sequences.push_back(sequence.sequence);
- manager->DidSatisfySequences(sequence.frame_sink_id, &sequences);
-}
-
-void RequireCallback(base::WeakPtr<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
-
class BlimpCompositor::FrameTrackingSwapPromise : public cc::SwapPromise {
public:
FrameTrackingSwapPromise(
@@ -331,12 +307,13 @@ void BlimpCompositor::SubmitCompositorFrame(cc::CompositorFrame frame) {
// manager must outlive compositors using it.
cc::SurfaceManager* surface_manager =
GetEmbedderDeps()->GetSurfaceManager();
- scoped_refptr<cc::SurfaceLayer> content_layer = cc::SurfaceLayer::Create(
- base::Bind(&SatisfyCallback, surface_manager->GetWeakPtr()),
- base::Bind(&RequireCallback, surface_manager->GetWeakPtr()));
- content_layer->SetSurfaceId(
- cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f,
- surface_size, false /* stretch_content_to_fill_bounds */);
+ auto content_layer =
+ cc::SurfaceLayer::Create(surface_manager->reference_factory());
+ cc::SurfaceId surface_id(surface_factory_->frame_sink_id(),
+ local_frame_id_);
+ content_layer->SetSurfaceInfo(
+ cc::SurfaceInfo(surface_id, 1.f, surface_size),
+ false /* stretch_content_to_fill_bounds */);
content_layer->SetBounds(current_surface_size_);
content_layer->SetIsDrawable(true);
content_layer->SetContentsOpaque(true);
« no previous file with comments | « no previous file | cc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698