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

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

RenderFrameProxy is one such call site.

BUG=759031

Change-Id: Id40e679f2c41876fd7e23aa8f2e70817445be420
Reviewed-on: https://chromium-review.googlesource.com/1024747
Commit-Queue: Chris Blume <cblume@chromium.org>
Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553724}
parent b5ec5693
...@@ -636,9 +636,9 @@ void RenderFrameProxy::SynchronizeVisualProperties() { ...@@ -636,9 +636,9 @@ void RenderFrameProxy::SynchronizeVisualProperties() {
capture_sequence_number_changed; capture_sequence_number_changed;
if (synchronized_props_changed) if (synchronized_props_changed)
local_surface_id_ = parent_local_surface_id_allocator_.GenerateId(); parent_local_surface_id_allocator_.GenerateId();
viz::SurfaceId surface_id(frame_sink_id_, local_surface_id_); viz::SurfaceId surface_id(frame_sink_id_, GetLocalSurfaceId());
if (enable_surface_synchronization_) { if (enable_surface_synchronization_) {
// If we're synchronizing surfaces, then use an infinite deadline to ensure // If we're synchronizing surfaces, then use an infinite deadline to ensure
// everything is synchronized. // everything is synchronized.
...@@ -657,7 +657,7 @@ void RenderFrameProxy::SynchronizeVisualProperties() { ...@@ -657,7 +657,7 @@ void RenderFrameProxy::SynchronizeVisualProperties() {
#if defined(USE_AURA) #if defined(USE_AURA)
if (rect_changed && mus_embedded_frame_) { if (rect_changed && mus_embedded_frame_) {
mus_embedded_frame_->SetWindowBounds(local_surface_id_, mus_embedded_frame_->SetWindowBounds(GetLocalSurfaceId(),
gfx::Rect(local_frame_size())); gfx::Rect(local_frame_size()));
} }
#endif #endif
...@@ -957,4 +957,8 @@ gfx::Rect RenderFrameProxy::ComputeCompositingRect( ...@@ -957,4 +957,8 @@ gfx::Rect RenderFrameProxy::ComputeCompositingRect(
return viewport_rect; return viewport_rect;
} }
const viz::LocalSurfaceId& RenderFrameProxy::GetLocalSurfaceId() const {
return parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
}
} // namespace content } // namespace content
...@@ -271,6 +271,8 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener, ...@@ -271,6 +271,8 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
gfx::Rect ComputeCompositingRect(const gfx::Rect& intersection_rect); gfx::Rect ComputeCompositingRect(const gfx::Rect& intersection_rect);
const viz::LocalSurfaceId& GetLocalSurfaceId() const;
// The routing ID by which this RenderFrameProxy is known. // The routing ID by which this RenderFrameProxy is known.
const int routing_id_; const int routing_id_;
...@@ -304,7 +306,6 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener, ...@@ -304,7 +306,6 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
bool crashed_ = false; bool crashed_ = false;
viz::FrameSinkId frame_sink_id_; viz::FrameSinkId frame_sink_id_;
viz::LocalSurfaceId local_surface_id_;
viz::ParentLocalSurfaceIdAllocator parent_local_surface_id_allocator_; viz::ParentLocalSurfaceIdAllocator parent_local_surface_id_allocator_;
bool enable_surface_synchronization_ = false; bool enable_surface_synchronization_ = false;
......
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