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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 2802023002: Remove SurfaceFactory And SurfaceFactoryClient (Closed)
Patch Set: Rebase Created 3 years, 8 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698