Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@chinmaygarde
Copy link
Member

This patch contains the following commits from chinmaygarde/flutter_engine/tree/session.

  • Fix erroneous call to restoreToCount(0).
  • Always include child paint bounds in container layer.
  • Trace skia resource cache usage and bytes in available surfaces.
  • Add surface pool stats.
  • Fix the canvas clear operation that was removed due to an incorrect rebase.
  • Do a single flush with a idle wait.
  • Initial commit of the vulkan surface pool in the content handler.
  • Optimize texture creation for frames.
  • Use new view manager API.
  • We only need scale factors on Fuchsia.
  • Set the correct transformation for clipping.
  • Render at most one frame at a time, really.
  • Always draw full-sized shape textures.
  • Generate at most one texture per physical layer.
  • Only draw when needed.
  • Correctly save/restore the canvas state.
  • Rasterize images to the containing physical model layer.
  • Fix several issues related to paint bounds calculations.
  • Don't bother setting paint bounds when using system compositing.
  • Plum through hit testing behavior.
  • Implement child scene embedding.
  • Simplify propagation of session through the layers.
  • Use mozart::client::ContainerNode.
  • Only compile SceneUpdateContext for Fuchsia builds.
  • Remove unwanted dependencies.
  • WIP: Update flow layers to use the new Session interface.

Copy link

@j9brown j9brown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with minor nits (mostly TODOs)

if (!is_ready_to_draw_)
return; // Only draw once per frame.
is_ready_to_draw_ = false;
if (!frame_outstanding_ || frame_rendering_)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't be discarding the layer tree here. But then, Flutter shouldn't be calling Render() if we didn't call BeginFrame(). So why does the spurious call to Render happen?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I think we should open a bug and leave a TODO here.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. MZ-193

// Attempt to read the device pixel ratio.
float pixel_ratio = 1.0;
if (auto& metrics = properties->display_metrics) {
pixel_ratio = 2.0; // TODO(chinmaygarde): Fix metrics->device_pixel_ratio;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metrics are being passed through correctly now. We should use them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


void SessionConnection::OnSessionError() {
ASSERT_IS_GPU_THREAD;
// TODO: Not this.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that a TODON'T? ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. At first I thought I should be doing something smarter, but terminating the process seems good enough to me :)


mx::vmo session_vmo;
mx_status_t status =
exported_vmo_.duplicate(MX_RIGHT_SAME_RIGHTS, &session_vmo);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't duplicate this handle. We don't need to keep it any further past this point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return session_image_ != nullptr;
}

uint32_t VulkanSurface::GetSessionImageID() const {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just expose the Image*.

mozart::client::Image* image() { return session_image_.get(); }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

void ClipRectLayer::UpdateScene(SceneUpdateContext& context) {
FTL_DCHECK(needs_system_composite());

// TODO(MZ-138): Need to be able to specify an origin.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the transform is sufficient to set the origin (and we already apply it). So let's remove this TODO here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

FTL_DCHECK(needs_system_composite());

// TODO(MZ-137): Need to be able to express the radii as vectors.
// TODO(MZ-138): Need to be able to specify an origin.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the transform is sufficient to set the origin (and we already apply it). So let's remove this TODO here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


// TODO(MZ-140): Must be able to specify paths as shapes to nodes.
// Treating the shape as a rectangle for now.
// TODO(MZ-138): Need to be able to specify an origin.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the transform is sufficient to set the origin (and we already apply it). So let's remove this TODO here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// Add a part which represents the frame's geometry for clipping purposes
// and possibly for its texture.
// TODO(MZ-137): Need to be able to express the radii as vectors.
// TODO(MZ-138): Need to be able to specify an origin.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the transform is sufficient to set the origin (and we already apply it). So let's remove this TODO here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

SceneUpdateContext::Transform::Transform(SceneUpdateContext& context,
const SkMatrix& transform)
: Entity(context) {
// TODO(chinmaygarde): The perspective and shear components in the matrix
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO(MZ-192)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link

@j9brown j9brown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, minor nits


// |flow::SceneUpdateContext::SurfaceProducerSurface|
uint32_t GetSessionImageID() const override;
mozart::client::Image* image() override;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this virtual anyhow? But since it is, per Google C++ style guide, this should be called GetImage(). Sorry for the churn.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface is defined in the flow library and there used to be two implementations in the content handler (one for Vulkan and one for software rasterization). The flow layer not know anything about the specific client rendering library used. Hence the virtual methods. I'll fix the signature.

}

auto session_image_id = surface->GetSessionImageID();
auto session_image_id = surface->image()->id();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return the Image* from this function instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@j9brown j9brown merged commit 925298d into flutter:master Jul 18, 2017
@chinmaygarde chinmaygarde deleted the session_review branch August 8, 2017 01:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants