Commit e8ba255d authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

DirectLayerTreeFrameSink to use allocator'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.

DirectLayerTreeFrameSink is one such call site.

BUG=759031

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I3b02013078ac09330eb076f542886a14b545ad73
Reviewed-on: https://chromium-review.googlesource.com/1024748Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553183}
parent a757c32a
......@@ -93,18 +93,22 @@ void DirectLayerTreeFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
DCHECK_LE(BeginFrameArgs::kStartingFrameNumber,
frame.metadata.begin_frame_ack.sequence_number);
if (!local_surface_id_.is_valid() ||
if (!parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId()
.is_valid() ||
frame.size_in_pixels() != last_swap_frame_size_ ||
frame.device_scale_factor() != device_scale_factor_) {
local_surface_id_ = parent_local_surface_id_allocator_.GenerateId();
parent_local_surface_id_allocator_.GenerateId();
last_swap_frame_size_ = frame.size_in_pixels();
device_scale_factor_ = frame.device_scale_factor();
display_->SetLocalSurfaceId(local_surface_id_, device_scale_factor_);
display_->SetLocalSurfaceId(
parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId(),
device_scale_factor_);
}
auto hit_test_region_list = CreateHitTestData(frame);
support_->SubmitCompositorFrame(local_surface_id_, std::move(frame),
std::move(hit_test_region_list));
support_->SubmitCompositorFrame(
parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId(),
std::move(frame), std::move(hit_test_region_list));
}
void DirectLayerTreeFrameSink::DidNotProduceFrame(const BeginFrameAck& ack) {
......
......@@ -96,7 +96,6 @@ class VIZ_SERVICE_EXPORT DirectLayerTreeFrameSink
std::unique_ptr<CompositorFrameSinkSupport> support_;
const FrameSinkId frame_sink_id_;
LocalSurfaceId local_surface_id_;
CompositorFrameSinkSupportManager* const support_manager_;
FrameSinkManagerImpl* frame_sink_manager_;
ParentLocalSurfaceIdAllocator parent_local_surface_id_allocator_;
......
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