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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 2802023002: Remove SurfaceFactory And SurfaceFactoryClient (Closed)
Patch Set: Rebase SurfaceSynchronizationTest Created 3 years, 7 months 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.cc ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index b9a679fdac16948605c7980a29930eadbd153359..93530ff6f21fa6d4937c630d5d97f9d3634fe911 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -25,6 +25,7 @@
#include "cc/quads/surface_draw_quad.h"
#include "cc/quads/texture_draw_quad.h"
#include "cc/resources/resource_provider.h"
+#include "cc/surfaces/compositor_frame_sink_support.h"
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_manager.h"
#include "cc/trees/blocking_task_runner.h"
@@ -120,11 +121,12 @@ SurfaceAggregator::ClipData SurfaceAggregator::CalculateClipRect(
return out_clip;
}
-static void UnrefHelper(base::WeakPtr<SurfaceFactory> surface_factory,
- const ReturnedResourceArray& resources,
- BlockingTaskRunner* main_thread_task_runner) {
- if (surface_factory)
- surface_factory->UnrefResources(resources);
+static void UnrefHelper(
+ base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support,
+ const ReturnedResourceArray& resources,
+ BlockingTaskRunner* main_thread_task_runner) {
+ if (compositor_frame_sink_support)
+ compositor_frame_sink_support->UnrefResources(resources);
}
int SurfaceAggregator::RemapPassId(int surface_local_pass_id,
@@ -145,11 +147,12 @@ int SurfaceAggregator::RemapPassId(int surface_local_pass_id,
int SurfaceAggregator::ChildIdForSurface(Surface* surface) {
auto it = surface_id_to_resource_child_id_.find(surface->surface_id());
if (it == surface_id_to_resource_child_id_.end()) {
- int child_id =
- provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory()));
- if (surface->factory()) {
+ int child_id = provider_->CreateChild(
+ base::Bind(&UnrefHelper, surface->compositor_frame_sink_support()));
+ if (surface->compositor_frame_sink_support()) {
provider_->SetChildNeedsSyncTokens(
- child_id, surface->factory()->needs_sync_points());
+ child_id,
+ surface->compositor_frame_sink_support()->needs_sync_points());
}
surface_id_to_resource_child_id_[surface->surface_id()] = child_id;
return child_id;
@@ -609,8 +612,9 @@ gfx::Rect SurfaceAggregator::PrewalkTree(const SurfaceId& surface_id,
// TODO(jbauman): hack for unit tests that don't set up rp
if (provider_) {
child_id = ChildIdForSurface(surface);
- if (surface->factory())
- surface->factory()->RefResources(frame.resource_list);
+ if (surface->compositor_frame_sink_support())
+ surface->compositor_frame_sink_support()->RefResources(
+ frame.resource_list);
provider_->ReceiveFromChild(child_id, frame.resource_list);
}
CHECK(debug_weak_this.get());
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698