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

Test LayerTreeFrameSink 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.

Test LayerTreeFrameSink is one such call site.

BUG=759031

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I17eea36d81726e50a1f5f46fadd3daa624f692c3
Reviewed-on: https://chromium-review.googlesource.com/1029538Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554638}
parent ddfe078c
......@@ -160,16 +160,19 @@ void TestLayerTreeFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
gfx::Size frame_size = frame.size_in_pixels();
float device_scale_factor = frame.device_scale_factor();
if (!local_surface_id_.is_valid() || frame_size != display_size_ ||
LocalSurfaceId local_surface_id =
parent_local_surface_id_allocator_->GetCurrentLocalSurfaceId();
if (!local_surface_id.is_valid() || frame_size != display_size_ ||
device_scale_factor != device_scale_factor_) {
local_surface_id_ = parent_local_surface_id_allocator_->GenerateId();
display_->SetLocalSurfaceId(local_surface_id_, device_scale_factor);
local_surface_id = parent_local_surface_id_allocator_->GenerateId();
display_->SetLocalSurfaceId(local_surface_id, device_scale_factor);
display_->Resize(frame_size);
display_size_ = frame_size;
device_scale_factor_ = device_scale_factor;
}
support_->SubmitCompositorFrame(local_surface_id_, std::move(frame));
support_->SubmitCompositorFrame(local_surface_id, std::move(frame));
// TODO(vmpstr): In layout tests, we request this call. However, with site
// isolation we don't get an activation yet. Previously the call to the
......@@ -183,7 +186,7 @@ void TestLayerTreeFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
// https://crbug.com/667551 tracks the progress of fixing this.
if (support_->last_activated_surface_id().is_valid()) {
for (auto& copy_request : copy_requests_)
support_->RequestCopyOfOutput(local_surface_id_, std::move(copy_request));
support_->RequestCopyOfOutput(local_surface_id, std::move(copy_request));
}
copy_requests_.clear();
......
......@@ -140,7 +140,6 @@ class TestLayerTreeFrameSink : public cc::LayerTreeFrameSink,
std::unique_ptr<FrameSinkManagerImpl> frame_sink_manager_;
std::unique_ptr<ParentLocalSurfaceIdAllocator>
parent_local_surface_id_allocator_;
LocalSurfaceId local_surface_id_;
gfx::Size display_size_;
float device_scale_factor_ = 0;
gfx::ColorSpace blending_color_space_ = gfx::ColorSpace::CreateSRGB();
......
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