Index: cc/surfaces/surface_aggregator.cc |
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc |
index 19fbc42b977bd348ecbd5a79c7fb8d3af6e86e18..baa07c698ab8f611744cac13fa42aa21c5033a8e 100644 |
--- a/cc/surfaces/surface_aggregator.cc |
+++ b/cc/surfaces/surface_aggregator.cc |
@@ -25,8 +25,8 @@ |
#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_factory.h" |
#include "cc/surfaces/surface_manager.h" |
#include "cc/trees/blocking_task_runner.h" |
@@ -121,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, |
@@ -147,11 +148,12 @@ int SurfaceAggregator::ChildIdForSurface(Surface* surface) { |
SurfaceToResourceChildIdMap::iterator 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; |
@@ -610,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()); |
@@ -753,8 +756,8 @@ gfx::Rect SurfaceAggregator::PrewalkTree(const SurfaceId& surface_id, |
} |
CHECK(debug_weak_this.get()); |
- if (surface->factory()) { |
- surface->factory()->WillDrawSurface( |
+ if (surface->compositor_frame_sink_support()) { |
+ surface->compositor_frame_sink_support()->WillDrawSurface( |
surface->surface_id().local_surface_id(), damage_rect); |
} |