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

LocalSurfaceIdProvider 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.

LocalSurfaceIdProvider is one such call site.

BUG=759031

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I85aad90edc9d61ae1c2924d3bbc5fc92b3b9376b
Reviewed-on: https://chromium-review.googlesource.com/1005801Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549647}
parent 1dcc8b7a
...@@ -16,14 +16,15 @@ DefaultLocalSurfaceIdProvider::DefaultLocalSurfaceIdProvider() = default; ...@@ -16,14 +16,15 @@ DefaultLocalSurfaceIdProvider::DefaultLocalSurfaceIdProvider() = default;
const LocalSurfaceId& DefaultLocalSurfaceIdProvider::GetLocalSurfaceIdForFrame( const LocalSurfaceId& DefaultLocalSurfaceIdProvider::GetLocalSurfaceIdForFrame(
const CompositorFrame& frame) { const CompositorFrame& frame) {
if (!local_surface_id_.is_valid() || if (!parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId()
.is_valid() ||
surface_size_ != frame.size_in_pixels() || surface_size_ != frame.size_in_pixels() ||
frame.device_scale_factor() != device_scale_factor_) { frame.device_scale_factor() != device_scale_factor_) {
local_surface_id_ = parent_local_surface_id_allocator_.GenerateId(); parent_local_surface_id_allocator_.GenerateId();
} }
surface_size_ = frame.size_in_pixels(); surface_size_ = frame.size_in_pixels();
device_scale_factor_ = frame.device_scale_factor(); device_scale_factor_ = frame.device_scale_factor();
return local_surface_id_; return parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
} }
} // namespace viz } // namespace viz
...@@ -34,7 +34,6 @@ class VIZ_CLIENT_EXPORT DefaultLocalSurfaceIdProvider ...@@ -34,7 +34,6 @@ class VIZ_CLIENT_EXPORT DefaultLocalSurfaceIdProvider
const CompositorFrame& frame) override; const CompositorFrame& frame) override;
private: private:
LocalSurfaceId local_surface_id_;
gfx::Size surface_size_; gfx::Size surface_size_;
float device_scale_factor_ = 0; float device_scale_factor_ = 0;
ParentLocalSurfaceIdAllocator parent_local_surface_id_allocator_; 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