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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2905523003: Revert of Enforce constant size and device scale factor for surfaces (Closed)
Patch Set: 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/compositor_frame_sink_support.h ('k') | cc/surfaces/compositor_frame_sink_support_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/compositor_frame_sink_support.cc
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
index 0a9684dc4f05b09a72c4584f8f61197aa461fdcd..896536f039cf4966b2c4204acb4034780d7765e6 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -97,7 +97,7 @@
begin_frame_source_->DidFinishFrame(this, ack);
}
-bool CompositorFrameSinkSupport::SubmitCompositorFrame(
+void CompositorFrameSinkSupport::SubmitCompositorFrame(
const LocalSurfaceId& local_surface_id,
CompositorFrame frame) {
TRACE_EVENT0("cc", "CompositorFrameSinkSupport::SubmitCompositorFrame");
@@ -131,35 +131,15 @@
if (!create_new_surface) {
surface = std::move(current_surface_);
} else {
- SurfaceId surface_id(frame_sink_id_, local_surface_id);
- gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
- float device_scale_factor = frame.metadata.device_scale_factor;
- SurfaceInfo surface_info(surface_id, device_scale_factor, frame_size);
-
- if (!surface_info.is_valid()) {
- TRACE_EVENT_INSTANT0("cc", "Invalid SurfaceInfo",
- TRACE_EVENT_SCOPE_THREAD);
- if (current_surface_)
- DestroyCurrentSurface();
- ReturnedResourceArray resources;
- TransferableResource::ReturnResources(frame.resource_list, &resources);
- ReturnResources(resources);
- DidReceiveCompositorFrameAck();
- return true;
- }
-
- surface = CreateSurface(surface_info);
- }
-
- bool result = surface->QueueFrame(
+ surface = CreateSurface(local_surface_id);
+ }
+
+ surface->QueueFrame(
std::move(frame),
base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck,
weak_factory_.GetWeakPtr()),
base::BindRepeating(&CompositorFrameSinkSupport::WillDrawSurface,
weak_factory_.GetWeakPtr()));
-
- if (!result)
- return false;
if (current_surface_) {
surface->SetPreviousFrameSurface(current_surface_.get());
@@ -174,8 +154,6 @@
// See https://crbug.com/703079.
if (begin_frame_source_)
begin_frame_source_->DidFinishFrame(this, ack);
-
- return true;
}
void CompositorFrameSinkSupport::UpdateSurfaceReferences(
@@ -353,10 +331,11 @@
}
std::unique_ptr<Surface> CompositorFrameSinkSupport::CreateSurface(
- const SurfaceInfo& surface_info) {
+ const LocalSurfaceId& local_surface_id) {
seen_first_frame_activation_ = false;
- return surface_manager_->CreateSurface(weak_factory_.GetWeakPtr(),
- surface_info);
+ std::unique_ptr<Surface> surface = surface_manager_->CreateSurface(
+ weak_factory_.GetWeakPtr(), local_surface_id);
+ return surface;
}
void CompositorFrameSinkSupport::DestroyCurrentSurface() {
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | cc/surfaces/compositor_frame_sink_support_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698