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

Unified Diff: ui/android/delegated_frame_host_android.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 | « ui/android/BUILD.gn ('k') | ui/compositor/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/delegated_frame_host_android.cc
diff --git a/ui/android/delegated_frame_host_android.cc b/ui/android/delegated_frame_host_android.cc
index 2ac22b38f7c24544c656e639d0f5f437df60f03d..436fefe9147d912a15b91f9f61ca29ce482a495a 100644
--- a/ui/android/delegated_frame_host_android.cc
+++ b/ui/android/delegated_frame_host_android.cc
@@ -25,37 +25,15 @@ namespace ui {
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);
-}
-
scoped_refptr<cc::SurfaceLayer> CreateSurfaceLayer(
cc::SurfaceManager* surface_manager,
cc::SurfaceId surface_id,
const gfx::Size surface_size,
bool surface_opaque) {
// manager must outlive compositors using it.
- scoped_refptr<cc::SurfaceLayer> layer = cc::SurfaceLayer::Create(
- base::Bind(&SatisfyCallback, surface_manager->GetWeakPtr()),
- base::Bind(&RequireCallback, surface_manager->GetWeakPtr()));
- layer->SetSurfaceId(surface_id, 1.f, surface_size,
- false /* stretch_content_to_fill_bounds */);
+ auto layer = cc::SurfaceLayer::Create(surface_manager->reference_factory());
+ layer->SetSurfaceInfo(cc::SurfaceInfo(surface_id, 1.f, surface_size),
+ false /* stretch_content_to_fill_bounds */);
layer->SetBounds(surface_size);
layer->SetIsDrawable(true);
layer->SetContentsOpaque(surface_opaque);
« no previous file with comments | « ui/android/BUILD.gn ('k') | ui/compositor/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698