Provide API for CompositorParent to use custom AsyncPanZoomController

RESOLVED FIXED in mozilla20

Status

()

Core
Graphics: Layers
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: romaxa, Assigned: romaxa)

Tracking

unspecified
mozilla20
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
I'm working on embedding API's which does rendering via CompositorParent implementation (fast and responsive embedding) see 746800.

Source code available here:
https://github.com/romaxa/mozilla-central/commits/embedlite
And I was able to reuse Gecko AsyncPanZoomController in that implementation with small additional change to CompositorParent.

idea of this change is to allow to get AsyncPanZoomController from derived CompositorParent class and allow to use it in compositor parent without LayerTree ID's and other static lists manipulation.
(Assignee)

Comment 1

5 years ago
Created attachment 693895 [details] [diff] [review]
Allow to use custom AsyncPanZoomController in compositor

With this patch and this implementation
https://github.com/romaxa/mozilla-central/commit/d959d00b1ec6c51a05bf533b26ff8c8ecc01f466#L6L13

I got nice working zooming,scrolling implementation almost out of the box.
Thanks for this component.
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #693895 - Flags: review?(bugzilla)
Comment on attachment 693895 [details] [diff] [review]
Allow to use custom AsyncPanZoomController in compositor

Review of attachment 693895 [details] [diff] [review]:
-----------------------------------------------------------------

I don't like the naming here and I think this could use more commenting.

::: gfx/layers/ipc/CompositorParent.cpp
@@ +795,4 @@
>    if (LayerUserData* data = aLayer->GetUserData(&sPanZoomUserDataKey)) {
> +    controller = static_cast<PanZoomUserData*>(data)->mController;
> +  } else {
> +    controller = GetPanZoomController();

This is basically saying "if the layer has an APZC, use it, otherwise try to get some arbitrary derived implementation's APZC." The "GetPanZoomController()" name doesn't give enough information about how it's intended to be used. Even something like "GetDefaultPanZoomController()" might work.
Attachment #693895 - Flags: review?(bugzilla) → review-
(Assignee)

Comment 3

5 years ago
Created attachment 694212 [details] [diff] [review]
Allow to use custom AsyncPanZoomController in compositor

Hope  this  is better.
Attachment #693895 - Attachment is obsolete: true
Attachment #694212 - Flags: review?(bugzilla)
Comment on attachment 694212 [details] [diff] [review]
Allow to use custom AsyncPanZoomController in compositor

Review of attachment 694212 [details] [diff] [review]:
-----------------------------------------------------------------

Cool, just a couple of comment nits.

::: gfx/layers/ipc/CompositorParent.cpp
@@ +791,5 @@
>      return appliedTransform;
>    }
>  
> +  AsyncPanZoomController* controller = nullptr;
> +  // Check if AsyncPanZoomController attached to the layer

// Check if an AsyncPanZoomController is attached to this layer.

@@ +796,4 @@
>    if (LayerUserData* data = aLayer->GetUserData(&sPanZoomUserDataKey)) {
> +    controller = static_cast<PanZoomUserData*>(data)->mController;
> +  } else {
> +    // check if derived class provide AsyncPanZoomController

// Check if a derived implementation provides a default AsyncPanZoomController.
Attachment #694212 - Flags: review?(bugzilla) → review+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/21db31128a72
https://hg.mozilla.org/mozilla-central/rev/21db31128a72
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.