Commit 545a6e14 authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

FrameGenerator to use alloctor's copy

The LSI allocators previously did not store a copy of the last generated
LSI. As a result, many call sites would have to keep their own copies.

Now that the LSI allocators have their own copies, the call sites can be
updated to no longer store a separate copy.

FrameGenerator is one such call site.

BUG=759031

Change-Id: I39774ba04f4bbfd61909e9df12df76c1fd76c492
Reviewed-on: https://chromium-review.googlesource.com/1029427
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553905}
parent b47fd5bb
......@@ -110,16 +110,17 @@ void FrameGenerator::OnBeginFrame(const viz::BeginFrameArgs& begin_frame_args) {
// TODO(fsamuel): We should add a trace for generating a top level frame.
viz::CompositorFrame frame(GenerateCompositorFrame());
if (!local_surface_id_.is_valid() ||
if (!id_allocator_.GetCurrentLocalSurfaceId().is_valid() ||
frame.size_in_pixels() != last_submitted_frame_size_ ||
frame.device_scale_factor() != last_device_scale_factor_) {
last_device_scale_factor_ = frame.device_scale_factor();
last_submitted_frame_size_ = frame.size_in_pixels();
local_surface_id_ = id_allocator_.GenerateId();
id_allocator_.GenerateId();
}
compositor_frame_sink_->SubmitCompositorFrame(
local_surface_id_, std::move(frame), GenerateHitTestRegionList(), 0);
id_allocator_.GetCurrentLocalSurfaceId(), std::move(frame),
GenerateHitTestRegionList(), 0);
SetNeedsBeginFrame(false);
}
......
......@@ -82,7 +82,6 @@ class FrameGenerator : public viz::mojom::CompositorFrameSinkClient {
viz::BeginFrameAck current_begin_frame_ack_;
bool high_contrast_mode_enabled_ = false;
gfx::Size last_submitted_frame_size_;
viz::LocalSurfaceId local_surface_id_;
viz::ParentLocalSurfaceIdAllocator id_allocator_;
float last_device_scale_factor_ = 0.0f;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment