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

Unified Diff: cc/surfaces/surface.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/surface.h ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.cc
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index e7164c9ae5c3b51bf2e070cec395f60efe9ed5ca..00de0c24878222656afe6be81862306cb3d699d2 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -24,10 +24,10 @@
static const int kFrameIndexStart = 2;
Surface::Surface(
- const SurfaceInfo& surface_info,
+ const SurfaceId& id,
base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support)
- : surface_info_(surface_info),
- previous_frame_surface_id_(surface_info.id()),
+ : surface_id_(id),
+ previous_frame_surface_id_(id),
compositor_frame_sink_support_(std::move(compositor_frame_sink_support)),
surface_manager_(compositor_frame_sink_support_->surface_manager()),
frame_index_(kFrameIndexStart),
@@ -55,19 +55,9 @@
closed_ = true;
}
-bool Surface::QueueFrame(CompositorFrame frame,
+void Surface::QueueFrame(CompositorFrame frame,
const base::Closure& callback,
const WillDrawCallback& will_draw_callback) {
- gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
- float device_scale_factor = frame.metadata.device_scale_factor;
-
- if (frame_size != surface_info_.size_in_pixels() ||
- device_scale_factor != surface_info_.device_scale_factor()) {
- TRACE_EVENT_INSTANT0("cc", "Surface invariants violation",
- TRACE_EVENT_SCOPE_THREAD);
- return false;
- }
-
if (closed_) {
if (compositor_frame_sink_support_) {
ReturnedResourceArray resources;
@@ -75,7 +65,7 @@
compositor_frame_sink_support_->ReturnResources(resources);
}
callback.Run();
- return true;
+ return;
}
TakeLatencyInfoFromPendingFrame(&frame.metadata.latency_info);
@@ -124,8 +114,6 @@
// Returns resources for the previous pending frame.
UnrefFrameResourcesAndRunDrawCallback(std::move(previous_pending_frame_data));
-
- return true;
}
void Surface::RequestCopyOfOutput(
@@ -319,7 +307,7 @@
if (!active_frame_data_ || active_frame_data_->will_draw_callback.is_null())
return;
- active_frame_data_->will_draw_callback.Run(surface_id().local_surface_id(),
+ active_frame_data_->will_draw_callback.Run(surface_id_.local_surface_id(),
damage_rect);
}
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698