Commit Graph

237 Commits

Author SHA1 Message Date
Ryan Hunt
f8c3615a4c Bug 1523969 part 8 - Move method definition inline comments to new line in 'gfx/'. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D21108
2019-02-25 16:07:19 -06:00
sotaro
0e138fec4a Bug 1513699 - Disable SkiaGL on WebRender r=jrmuizel
Disable SkiaGL on WebRender, since there is a case that R8G8B8X8 is used, but WebRender does not support R8G8B8X8 yet. And SkiaGL is already disabled by Bug 1468801.

Differential Revision: https://phabricator.services.mozilla.com/D14366
2018-12-13 18:01:16 +09:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Jeff Gilbert
4514a08257 Bug 1492580 - Repair CONTEXT_LOST handling. r=lsalzman
Simplify error handling in GLContext.
Modernize context loss handling in GLContext.
Remove various unused parts.
Fix WebGLContext's context loss/restoration.

MozReview-Commit-ID: Lu2hi5HnP8x

Differential Revision: https://phabricator.services.mozilla.com/D12496
2018-11-27 04:23:19 +00:00
Imanol Fernandez
a8c39f6eea Bug 1478754 - WebGL crash when webgl.enable-surface-texture is enabled on Android; r=jgilbert,rbarker
MozReview-Commit-ID: GBTvZiLspvP
2018-07-28 12:33:55 +02:00
Ryan Hunt
be6483bb76 Allocate TextureReadLock at TextureClient creation and drop file handles immediately after. (bug 1416726, r=aosmond)
This changes the lifecycle and API for TextureReadLock to fix file descriptor exhaustion
crashes. These changes are partially superficial and mostly align the API of TextureReadLocks
with their actual usage.

The changes are:

1. Create the TextureReadLock in the TextureClient constructor so it's available before IPC creation
    a. This is superficial as EnableReadLock was always called before IPC creation
2. Send the ReadLockDescriptor in the PTextureConstructor message and close the file handle
3. Receive the ReadLockDescriptor in TextureHost and close the file handle
4. Send a boolean flag in layer transactions if the texture is read locked instead of a descriptor
5. Use a boolean flag in TextureHost to determine if the ReadLock must be unlocked instead of a nullptr

I believe that we can remove the InitReadLocks code from LayerTransaction as that was added to
prevent file descriptor limits in IPDL messages and is no longer needed with this change. But
that is a non-essential change and this patch is already big enough.

MozReview-Commit-ID: DzHujrOQejH
2018-03-12 08:10:13 -05:00
Milan Sreckovic
19df0d5bcf Bug 1432411: Wallpaper over the case where there is no Screen. r=jgilbert
MozReview-Commit-ID: ISeBw7qxGdH
2018-02-09 13:42:17 -05:00
David Anderson
afaed3e050 Don't fallback to DrawTargetCairo in TextureClient. (bug 1413862, r=mattwoodrow) 2017-11-08 16:57:25 -08:00
Daniel Holbert
bb0a8b6602 Bug 1412427 part 8: (automated patch) Switch a bunch of C++ files in gfx to use our standard mode lines. r=jrmuizel
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: 77D61xpSmIl
2017-10-27 16:10:06 -07:00
Kearwood "Kip" Gilbert
e1c2b94f20 Bug 1400407 - Part 3: Remove IsMirror concept, as it is no longer used by WebVR,r=jgilbert
- This patch is the same as one from Bug 1382104 (Remove IsMirror concept
  in favor of checking forwarder).
- It is safe to uplift this patch without the rest of Bug 1382104 as long
  as the remaining Bug 1381084 is also uplifted.

MozReview-Commit-ID: 21YZObeSUa3
2017-08-28 14:50:14 -07:00
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
James Willcox
d860d36ae0 Bug 1322650 - Use SurfaceTexture for WebGL on Android in E10S r=jgilbert
The main advantage here is that it works cross-process.

MozReview-Commit-ID: 7YUTVB4Bydg
2017-05-15 09:37:44 -05:00
Iris Hsiao
3cea13a680 Backed out 11 changesets (bug 1322650) for media test failures on android. a=backout
Backed out changeset 31bd912fba54 (bug 1322650)
Backed out changeset 4d486c7469eb (bug 1322650)
Backed out changeset 4cf8f4d5064c (bug 1322650)
Backed out changeset 3cb108f7492f (bug 1322650)
Backed out changeset bd53533c108e (bug 1322650)
Backed out changeset 3522917d8f10 (bug 1322650)
Backed out changeset 2c2c1e33eccc (bug 1322650)
Backed out changeset 2f19977cd6ab (bug 1322650)
Backed out changeset 4519296a323e (bug 1322650)
Backed out changeset e56e5e1c8786 (bug 1322650)
Backed out changeset 96fe52231b57 (bug 1322650)
2017-05-12 10:21:14 +08:00
James Willcox
9f0c7ce5fc Bug 1322650 - Use SurfaceTexture for WebGL on Android in E10S r=jgilbert
The main advantage here is that it works cross-process.

MozReview-Commit-ID: 7YUTVB4Bydg
2017-05-11 15:42:42 -05:00
Sebastian Hengst
7700b0dbdc Backed out changeset 9badb2705567 (bug 1322650) 2017-05-05 18:54:09 +02:00
James Willcox
c385f42ceb Bug 1322650 - Use SurfaceTexture for WebGL on Android in E10S r=jgilbert
The main advantage here is that it works cross-process.

MozReview-Commit-ID: 7YUTVB4Bydg
2017-05-05 08:56:28 -05:00
sotaro
7585ae6fe9 Bug 1349476 - Remove LayersBackend::LAYERS_D3D9 type r=mattwoodrow 2017-03-23 11:00:41 +09:00
David Anderson
31ae23d1eb Replace async image container IDs with a typed struct. (bug 1323957 part 1, r=mattwoodrow) 2017-01-17 18:47:05 -08:00
Morris Tseng
08d68942a0 Bug 1322500 - Introducing ShareableCanvasLayer. r=sotaro
MozReview-Commit-ID: 1zVJ3HVQV9W
2016-12-28 10:16:43 +08:00
David Anderson
af9c206edd Fix canvas crashing when the GPU process aborts. (bug 1314427, r=nical) 2016-11-15 13:04:59 -08:00
Matt Woodrow
16f8a8bdeb Bug 1308363 - Remove GONK specific code from gfx/. r=jrmuizel,sotaro 2016-10-27 13:17:10 +13:00
Matt Woodrow
2dabc216dc Bug 1281456 - Decouple TextureForwarder and CompositableForwarder. r=gw280 2016-09-27 16:22:20 +13:00
Kearwood (Kip) Gilbert
f9fd286412 Bug 1250244 - Part 2: Remove old VR rendering paths,r=gw280
MozReview-Commit-ID: 8H7spQggI2w
2016-05-27 13:49:04 -07:00
Nicolas Silva
a400802da9 Bug 1289816 - Simplify CopyableCanvasLayer::UpdateTarget and remove unnecessary copies. r=jnicol 2016-07-29 20:19:28 +02:00
Nicolas Silva
e022eef660 Bug 1290081 - Make canvas layer transactions asynchronous. r=sotaro 2016-07-29 20:19:23 +02:00
Wes Kocher
aa15caaf1e Backed out changeset 67cb195b1b45 (bug 1290081) for canvas reftest failures 2016-07-28 13:09:07 -07:00
Nicolas Silva
bbcb2de8bf Bug 1290081 - Make canvas layer transactions asynchronous. r=sotaro 2016-07-28 17:58:33 +02:00
Nicolas Silva
a0adabcd8e Bug 1289380 - Simplify PersistentBufferProviderShared. r=edwin 2016-07-27 16:50:20 +02:00
Jeff Gilbert
c3f06288b1 Bug 1250710 - Update usages of ScopedPackAlignment. - r=jrmuizel
MozReview-Commit-ID: DgngFxBu8kn
2016-07-17 21:44:33 -07:00
kearwood
b5b6726ccc Bug 1284324 - Implement Canvas Layer mirrors r=bas
- When a canvas layer is set to mirror, it copies the
  texture from the canvas rather than changing the
  texture factory with Morph().
- This is useful when a canvas content will be sent to
  multiple devices simultaneously, such as a VR HMD
  and a 2d monitor mirror.
- This is used by the WebVR 1.0 API, in Bug 1250244

MozReview-Commit-ID: JfMSockO2uz
2016-07-04 13:11:07 -07:00
Nicolas Silva
84cb9d96a7 Bug 1167235 - Part 1 - Render canvas2D into TextureClient directly. r=Bas 2016-07-01 10:58:06 +02:00
Sebastian Hengst
cf24627d37 Backed out changeset 14dfa550c783 (bug 1167235) 2016-06-28 20:28:23 +02:00
Nicolas Silva
fe2f5020fe Bug 1167235 - Part 1 - Render canvas2D into TextureClient directly. r=Bas 2016-06-28 14:06:51 +02:00
Sotaro Ikeda
f12a4d5803 Bug 1281374 - Update CanvasClientSharedSurface::ClearSurfaces() r=nical 2016-06-22 06:15:14 -07:00
Sotaro Ikeda
cc18201e0b Bug 1252835 - Make TextureHost recycling implicit r=nical 2016-06-15 04:28:10 -07:00
Jonathan Watt
9c5b8de022 Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Edwin Flores
5cf8ef0941 Bug 1270428 - Cancel wait for texture recycle when CanvasClient is shutting down - r=nical 2016-05-16 12:55:02 +01:00
Ethan Lin
8b350e532a Bug 1268302 - Fix performance regression in glterrain. r=jgilbert 2016-04-29 02:19:00 -04:00
Ethan Lin
b48f16c4a5 Bug 1250954 - Correct the SharedSurfaceTextureClient when forwarder changed. r=jgilbert 2016-04-13 23:27:00 +02:00
Morris Tseng
2e5febe3d7 Bug 1265638 - Reset some properties when the backend of SharedSurface is switching from Basic to layer-accelerated backend. r=jgilbert
MozReview-Commit-ID: JWXA79i3aEC
2016-04-26 11:08:56 +08:00
David Anderson
7b7cd394cc Rename PCompositor to PCompositorBridge. (bug 1258479 part 2, r=mattwoodrow) 2016-03-22 14:08:38 -04:00
Nicolas Silva
000ef2da39 Bug 1256693 - Refer to ClientIPCAllocator instead of ISurfaceAllocator where it makes sense. r=sotaro 2016-03-21 15:18:20 +01:00
Wes Kocher
19cb008beb Backed out changeset 7a74257343be (bug 1256693) for media mochitest leaks CLOSED TREE
MozReview-Commit-ID: Em8nObLSj9r
2016-03-17 15:42:51 -07:00
Nicolas Silva
43f63465fe Bug 1256693 - Refer to ClientIPCAllocator instead of ISurfaceAllocator where it makes sense. r=sotaro 2016-03-17 14:59:06 +01:00
Edwin Flores
041e05ce2d Bug 1253386 - Double buffer in CanvasClient2D - r=nical 2016-03-17 11:11:18 +00:00
Phil Ringnalda
712fd4e2ee Back out 9 changesets (bug 801176) for frequent crashes in test_offscreencanvas_dynamic_fallback.html
Backed out changeset 82320c900699 (bug 801176)
Backed out changeset 624fb8512ba5 (bug 801176)
Backed out changeset a2a7b1c4dc5b (bug 801176)
Backed out changeset e210473d793c (bug 801176)
Backed out changeset 0fb279e041e1 (bug 801176)
Backed out changeset c090dc98c670 (bug 801176)
Backed out changeset fc509e59a0cd (bug 801176)
Backed out changeset 134a8c56335a (bug 801176)
Backed out changeset 2022afa9aef2 (bug 801176)
2016-03-05 07:20:47 -08:00
vincentliu
d8ed700357 Bug 801176 - part7-v1: Don't remove TextureClient until the frame update is done. r=roc
---
 gfx/layers/client/CanvasClient.cpp | 10 ++++++++--
 gfx/layers/client/CanvasClient.h   |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)
2016-03-04 15:24:19 +08:00
vincentliu
fd0afbeb0e Bug 801176 - part2-v5: Let Canvas 2d context works on Workers. r=roc
---
 dom/canvas/CanvasRenderingContext2D.cpp | 53 ++++++++++++-----------
 dom/canvas/OffscreenCanvas.cpp          | 46 +++++++++++---------
 dom/html/HTMLCanvasElement.cpp          |  1 +
 gfx/layers/AsyncCanvasRenderer.cpp      | 17 ++++++++
 gfx/layers/AsyncCanvasRenderer.h        | 16 +++++++
 gfx/layers/Effects.cpp                  |  6 +++
 gfx/layers/GLImages.cpp                 |  5 +--
 gfx/layers/client/CanvasClient.cpp      | 74 +++++++++++++++++++++++++--------
 gfx/layers/client/CanvasClient.h        | 10 ++++-
 9 files changed, 162 insertions(+), 66 deletions(-)
2016-03-04 15:22:39 +08:00
kearwood
ccf22e27a5 Bug 1237689 - Enable Oculus hardware latency tester r=daoshengmu
- Generate and pass sequential frame indexes into the ovr_GetTrackingState call and the corresponding call to ovr_SubmitFrame

MozReview-Commit-ID: 5tJl5YJt7Eo
2016-01-08 18:50:10 -08:00
Birunthan Mohanathas
bfee0fb40c Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00