Commit Graph

500 Commits

Author SHA1 Message Date
Morris Tseng
cb1ff9368d Bug 1379920 - Introduce CanvasRenderer and its derived classes. r=nical,jrmuizel
This patch move common canvas interfaces out of layer. So I create a
base class CanvasRenderer which move interfaces from CanvasLayer.
CopyableCanvasRenderer from CopyableCanvasLayer, ClientCanvasRenderer
from ClientCanvasLayer and WebRenderCanvasRenderer from
WebRenderCanvasLayer. And finally, WebRenderCanvasRendererSync for the
non layers free mode and WebRenderCanvasRendererAsync for the layers
free mode.

Summary all changes in this patch.
* Move class CanvasLayer::Data to CanvasRenderer.h and rename it to
CanvasInitializeData. Because this class not only use by layer but also
* Move BasicCanvasLayer::UpdateSurface to
CopyableCanvasRenderer::ReadbackSurface.
* CanvasClient::Update now accepts ShareableCanvasRenderer as parameter.
not CanvasLayer.
use by layers-free mode. Move it out of layer's class makes more sense.
* Add InitializeCanvasRenderer in the canvas related classes to
initialize CanvasRenderer without involved layer.
* All canvas layer has function "CreateCanvasRendererInternal" that
initialize corresponding CanvasRenderer.

* Description of all CanvasRenderer classes:
** CanvasRenderer: Based classes.
** CopyableCanvasRenderer: Can readback canvas content to a
SourceSurface. Use by BasicCanvasLayer.
** ShareableCanvasRenderer: Provide IPC capabilities that allow sending
canvas content over IPC. This is pure virtual class because the IPC handling is
different in different LayerManager.
** ClientCanvasRenderer: Implement IPC handling for ClientLayerManager.
Use by ClientCanvasLayer.
** WebRenderCanvasRenderer: Implement IPC handling for
WebRenderLayerManager.
** WebRenderCanvasRendererSync: Use by WebRenderCanvasLayer.
** WebRenderCanvasRendererAsync: Use by layers-free mode in WebRender.

class diagram shows below:

                      +--------------+
                      |CanvasRenderer|
                      +-------+------+
                              ^
                              |
                  +----------------------+
                  |CopyableCanvasRenderer|
                  +----------------------+
                              ^
                              |
                  +-----------+-----------+
                  |ShareableCanvasRenderer|
                  +-----+-----------------+
                        ^      ^
          +-------------+      +-------+
          |                            |
+--------------------+       +---------+-------------+
|ClientCanvasRenderer|       |WebRenderCanvasRenderer|
+--------------------+       +--------+--+-----------+
                                      ^  ^
              +-----------------------+  +----+
              |                               |
+-------------+-------------+   +-------------+--------------+
|WebRenderCanvasRendererSync|   |WebRenderCanvasRendererAsync|
+---------------------------+   +----------------------------+

MozReview-Commit-ID: 5hqQ19W169r
2017-08-03 13:55:14 +08:00
Ryan VanderMeulen
af0aa4cb17 Merge m-c to inbound. a=merge 2017-07-21 09:40:28 -04:00
Kartikaya Gupta
581aec4865 Bug 1359808 - Don't do empty transactions for scroll updates if there are already pending transforms in the layer tree. r=mstange
The pending transforms must have been computed using the older scroll offset
values, which means that updating the scroll offsets without recomputing the
transforms will make them wrong. If we do an empty transaction for the scroll
offset updates, the transforms will not get computed. This patch catches this
scenario and schedules a full paint instead of the empty transaction instead.
The case where the scroll offset is modified *before* the transform is already
handled by code in nsIFrame::TryUpdateTransformOnly.

MozReview-Commit-ID: I5s5J7BS1ru
2017-07-12 11:14:11 -04:00
Ethan Lin
bb03921d18 Bug 1378602 - Part2. Move animation data from layer to AnimationInfo. r=kats
MozReview-Commit-ID: 4gv8EfPgsii
2017-07-21 14:21:47 +08:00
Kartikaya Gupta
2800e31568 Bug 1382200 - Rename Layer::IsScrollInfoLayer to better capture what the call sites care about. r=botond
MozReview-Commit-ID: 1vMBMo5zOhK
2017-07-19 09:24:22 -04:00
peter chang
d2c7852863 Bug 1373836 - Generate fixed animation id per layer if animations exist, r=kats
In gecko, it's possible to generate lots of animation ids per layer if animations are changed.
It also introduces lots of memory allocation/deallocation in CompositorAnimationStorage(HashTable).
Generate fixed animations id per layer should help the memory usage and reduce CPU time for memory allocation.
MozReview-Commit-ID: 1hWUD5gNBJH
2017-06-28 09:31:10 -07:00
David Anderson
ea8f914339 Implement LayerMLGPU::SetLayerManager. (bug 1375759, r=mattwoodrow) 2017-06-27 13:11:01 -07:00
Sebastian Hengst
9bef7cce71 Backed out changeset 9db369ba372c (bug 1375759) for unused mComputedDrawRegion. r=backout 2017-06-27 20:47:30 +02:00
David Anderson
eb5b8e7c7a Implement LayerMLGPU::SetLayerManager. (bug 1375759, r=mattwoodrow) 2017-06-27 11:31:37 -07:00
David Anderson
95ef1f77d4 Allow LayerManagers to disable complex component alpha cases. (bug 1365879 part 19, r=mattwoodrow) 2017-06-20 01:17:22 -07:00
David Anderson
8beaf4758e Allow LayerManagers to force intermediate surfaces for blend containers. (bug 1365879 part 11, r=mattwoodrow) 2017-06-20 01:17:19 -07:00
Markus Stange
56fdc91c14 Bug 1368386 - Make PaintedLayer::mValidRegion private so that its access can be tightly controlled. r=mattwoodrow
MozReview-Commit-ID: LdtH3hrXT5v
2017-06-15 18:20:53 -04:00
Kartikaya Gupta
eb57c3b090 Bug 1373012 - Log the clip mask indices in the layers dump. r=mstange
MozReview-Commit-ID: HmwDyV4Pga0
2017-06-14 15:18:16 -04:00
Kartikaya Gupta
b71424ac7c Bug 1364525 - Ensure all scroll thumbs have an animations id. r=pchang
In order to have the scrollbar thumbs reflect the async scroll position, we're
going to re-use the API for OMTA. That is, we set an animation id on the
stacking context for the scroll thumb, and we'll update the transform on the
stacking context at composite time based on the async scroll position. For this
to work we need to ensure that the scroll thumb does in fact have an
animation id set on it.

MozReview-Commit-ID: 6TvRemxRUrR
2017-05-23 10:50:41 -04:00
Botond Ballo
50e80233ca Bug 1349750 - Group scroll thumb-related information in Layer into a ScrollThumbData structure. r=kats
The patch also renames Layer::SetScrollbarData() to Layer::SetScrollThumbData()
for clarity.

MozReview-Commit-ID: DVwJ3DMl3Zs
2017-05-10 14:02:15 -04:00
Brian Birtles
2ada0df47e Bug 1334583 - Pass a separate timeOrigin and startTime for compositor animations; r=hiro
By passing the startTime as a TimeDuration we are able to represent times in the
distant past (and with the same range as we can represent on the main thread so
that if we do encounter range errors in future, they should not differ between
the main thread and the compositor).

This patch includes a crashtest. I have verified that, without the code changes
included in this patch, this crashtest fails on debug builds on OSX.

MozReview-Commit-ID: EDuKLzfEC0K
2017-05-02 16:49:51 +09:00
Brian Birtles
96a467398f Bug 1361260 - Incorporate playbackRate when calculating the start time of a pending compositor animation; r=hiro
MozReview-Commit-ID: FBmT5ImBcYJ
2017-05-02 16:43:21 +09:00
Brian Birtles
75a009e351 Bug 1361234 - Fix start time calculation for pending animations on layers; r=hiro
In bug 1223658 we separated out the delay from the start time but we failed to
remove it from this calculation. As a result, when a pending animation begins it
will have the delay applied twice (once here, and once when it is sampled on the
compositor). This will happen until the layer is next updated.

This bug was not exposed by any existing tests since we don't use this code path
when the refresh driver is under test control. Furthermore, the one test that
was supposed to cover this was refactored in such a way that it stopped testing
this code path. That test is restored earlier in this patch series and enabled
in this patch.

MozReview-Commit-ID: B2KR7YaPsMK
2017-05-02 16:41:13 +09:00
Markus Stange
27efd88cbc Bug 1349418 - Remove checkerboarding code and just use an opaque background color behind root scroll frames. r=kats 2017-04-21 14:02:15 +12:00
Kartikaya Gupta
f8bacc7c52 Merge m-c to graphics
MozReview-Commit-ID: 3s6ISsQ3jG9
2017-04-24 09:17:28 -04:00
Kartikaya Gupta
3af8d29cef Merge m-c to graphics
MozReview-Commit-ID: 5zsIClrx1FB
2017-04-21 10:01:47 -04:00
peter chang
f11c1bde12 Bug 1345017 - Add animation sampling for WR, r=kats
MozReview-Commit-ID: AR2vajUf2o0
2017-04-12 16:40:48 +08:00
Sebastian Hengst
036a7b0984 Backed out changeset 435e638babd1 (bug 1349418) for failing checkerboard-{1,2,3}.html on Android 4.3. r=backout a=backout
MozReview-Commit-ID: Au7FbypQNvf
2017-04-21 18:01:24 +02:00
Wes Kocher
e18b7d684a Merge inbound to central, a=merge 2017-04-13 17:24:01 -07:00
Miko Mynttinen
17eafa1c69 Bug 1351426 - Part 3: Refactor BSPTree to use list instead of deque and use arena for memory allocations r=kip
MozReview-Commit-ID: F4ezRzbGihI
2017-04-10 16:35:56 +02:00
Ehsan Akhgari
1052e966ba Bug 1354412 - Remove nsIDOMWindowUtils.beginTabSwitch(); r=jrmuizel 2017-04-12 23:31:39 -04:00
Markus Stange
f07c1773ab Bug 1349418 - Remove checkerboarding code and just use an opaque background color behind root scroll frames. r=kats 2017-04-21 14:02:15 +12:00
Chris Peterson
ff33c00f6a Bug 1356843 - Fix -Wcomma warnings in gfx/layers/Layers.cpp. r=mchang
clang's -Wcomma warning warns about suspicious use of the comma operator such as between two statements.

gfx/layers/Layers.cpp:1944:33 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1945:33 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1946:33 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1949:37 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1950:37 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1951:37 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1952:37 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1953:37 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1954:37 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1955:37 [-Wcomma] possible misuse of comma operator here
gfx/layers/Layers.cpp:1956:37 [-Wcomma] possible misuse of comma operator here

MozReview-Commit-ID: 9lMJZrPRtTV
2017-03-27 21:29:42 -07:00
Iris Hsiao
f58321a2b0 Backed out changeset 3910de7acce3 (bug 1349418) 2017-04-10 14:42:38 +08:00
Markus Stange
f510a8a0ad Bug 1349418 - Remove checkerboarding code and just use an opaque background color behind root scroll frames. r=kats 2017-04-10 17:01:53 +12:00
Sebastian Hengst
9ecf8b7651 Backed out changeset 2c56897d9ed1 (bug 1351426) 2017-04-11 20:02:40 +02:00
Miko Mynttinen
13293ab251 Bug 1351426 - Part 3: Refactor BSPTree to use list instead of deque and use arena for memory allocations r=kip
MozReview-Commit-ID: F4ezRzbGihI
2017-04-10 16:35:56 +02:00
Carsten "Tomcat" Book
ab13fda3b9 Backed out changeset a6c0e4789330 (bug 1351426) 2017-04-10 15:15:21 +02:00
Miko Mynttinen
392d7e6bd7 Bug 1351426 - Part 3: Refactor BSPTree to use list instead of deque r=kip
MozReview-Commit-ID: F4ezRzbGihI
2017-04-05 20:12:35 +02:00
Mason Chang
02db758087 Bug 1351114 Properly track display item layers in layer managers. r=mattwoodrow 2017-03-28 22:37:11 -07:00
peter chang
12f701a514 Bug 1337889 - Add CompositorAnimationsId for layer animations, r=hiro
MozReview-Commit-ID: 4r9VhF4Vp2l
2017-02-08 14:31:45 -05:00
Miko Mynttinen
677f3e434e Bug 1338997 - Ensure that the transformation matrices are invertible r=mattwoodrow
MozReview-Commit-ID: A5nHNcnkrNN
2017-02-23 20:42:10 +01:00
Kartikaya Gupta
4979fd659f Merge m-c to graphics
MozReview-Commit-ID: IN2hMCjMHLL
2017-02-17 23:33:24 -05:00
Mason Chang
e98ed22835 Bug 1337130 - Create a DisplayItemLayer type. r=mattwoodrow 2017-02-14 13:49:27 -08:00
Tom Tromey
e90d95a3f9 Bug 1060419 - make AppendPrintf and nsPrintfCString use Printf.h, r=froydnj
MozReview-Commit-ID: 2E8FoiNxU8L
2016-12-14 09:32:21 -07:00
peter chang
0ec7b5f26c Bug 1332211 - Move Layer::SetAnimation into AnimationHelper, r=hiro
MozReview-Commit-ID: JQMAJt8lvYo
2017-01-25 10:51:30 +08:00
David Anderson
d570007deb Fix missing mutation when changing SimpleLayerAttributes. (bug 1334715, r=mattwoodrow) 2017-01-30 21:36:23 -08:00
David Anderson
3b07e8a48a Send SimpleLayerAttributes separately from CommonLayerAttributes. (bug 1332567 part 6, r=mattwoodrow) 2017-01-24 16:41:18 -08:00
David Anderson
6353c6e1a0 Factor POD attributes of Layers into a SimpleLayerAttributes class. (bug 1332567 part 5, r=mattwoodrow) 2017-01-24 16:41:18 -08:00
David Anderson
d46521f0e5 Move ScrollDirection to LayersTypes.h and make it a proper enum. (bug 1332567 part 1, r=kats) 2017-01-24 16:41:17 -08:00
Sylvestre Ledru
62c6242f05 Bug 1338086 - Remove useless else blocks in order to reduce complexity in gfx/ r=nical
MozReview-Commit-ID: H9zZd19V4Ww
2017-02-09 13:39:27 +01:00
Milan Sreckovic
3ab9239a2b Bug 1328702: ContainerLayer::RemoveAllChildren implementation. r=kats,mattwoodrow
MozReview-Commit-ID: 6zC3v8dQcWD
2017-01-05 13:41:10 -05:00
Hiroyuki Ikezoe
a2416ba517 Bug 1311620 - Part 3: Incorporate null_t in Animatable. r=birtles
We couldn't tell the difference between a null StyleAnimationValue and
transform:none on the compositor. This was not a problem before, since we didn't
need the null StyleAnimationValue on the compositor, because the null
StyleAnimationValue have to be passed with composite:add flag, and in the case of
composite:add we just used the underlying value, i.e. we didn't use the null
value at all.
But for normal additive animations, we have to check the null StyleAnimationValue
to tell whether we are processing a missing keyframe or not.
So in this patch, Animatable can be null_t to represent the null
StyleAnimationValue, and as a result of this change, we can drop
BaseAnimationStyle.

MozReview-Commit-ID: Au41ujHgPpU
2016-12-24 17:27:18 +09:00
Botond Ballo
2627edc4ea Bug 1321885 - Show the number of OMT animations on a layer in the layer dump. r=kats
MozReview-Commit-ID: KmG0TKEKZRR
2016-07-20 14:53:38 -04:00
Miko Mynttinen
45fcf4cf9c Bug 1274673 - Use binary space partitioning for sorting/drawing layers - Part 3: Use BSPTree for layer sorting r=jrmuizel,mattwoodrow
MozReview-Commit-ID: 3Hy4IRDFgaP
2016-12-06 13:39:01 -10:00