Граф коммитов

67 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 97cdacf51c Bug 1874241 - Cache current DrawTarget in recordings. r=gfx-reviewers,lsalzman
Since most draw commands in a recording reference the same DrawTarget
over and over again, it saves a lot of space in the recording buffer to
create a dedicated RecordedSetCurrentDrawTarget command which caches the
current DrawTarget pointer and each subsequent command that needs a
DrawTarget will use the current.

Differential Revision: https://phabricator.services.mozilla.com/D198310
2024-01-15 18:09:47 +00:00
Andrew Osmond 25d36e4cfb Bug 1870872 - Create dedicated recording event for canvas DrawTarget creation. r=gfx-reviewers,lsalzman
This patch merges RecordedNextTextureId and RecordedDrawTargetCreation
into a single event RecordedCanvasDrawTargetCreation for recording
canvases. This should ensure that we do not somehow miss providing the
relevant remote texture IDs. It also now diagnostic asserts that canvas
recording/playback do not use the original RecordedDrawTargetCreation
event.

Differential Revision: https://phabricator.services.mozilla.com/D198124
2024-01-10 14:31:41 +00:00
Norisz Fay 6ed555a482 Backed out changeset 7801925e6b44 (bug 1870872) as requested by aosmond CLOSED TREE 2024-01-10 16:25:53 +02:00
Nicolas Chevobbe 3e7ecc45a0 Bug 1870872 - Create dedicated recording event for canvas DrawTarget creation. r=gfx-reviewers,lsalzman
This patch merges RecordedNextTextureId and RecordedDrawTargetCreation
into a single event RecordedCanvasDrawTargetCreation for recording
canvases. This should ensure that we do not somehow miss providing the
relevant remote texture IDs. It also now diagnostic asserts that canvas
recording/playback do not use the original RecordedDrawTargetCreation
event.

Differential Revision: https://phabricator.services.mozilla.com/D198124
2024-01-10 14:01:34 +00:00
Andrew Osmond 484b8d4e39 Bug 1871613 - Ensure CanvasDrawEventRecorder releases external surface dependencies. r=gfx-reviewers,lsalzman
This patch makes CanvasDrawEventRecorder track what eventCount we
recorded an external surface reference. When the reader has increment
its processedCount above that, we will release our reference as it
should have acquired a strong reference to the data. This was previously
done when we forwarded the texture, but with remote textures, we no
longer have this event. Now we check when we start a new recording, or
attempt to clear cached resources.

Differential Revision: https://phabricator.services.mozilla.com/D197216
2023-12-23 01:34:31 +00:00
Andrew Osmond 0837c517ad Bug 1870957 - Part 1. Add/update owning thread assertions to CanvasChild/DrawEventRecorder. r=gfx-reviewers,lsalzman
This patch adds/updates the thread assertion plumbing for CanvasChild
and DrawEventRecorder to ensure that we are always accessing them on the
owning thread. It also now makes these checks compatible with running in
a DOM worker context for OffscreenCanvas using recordings.

Differential Revision: https://phabricator.services.mozilla.com/D189526
2023-12-20 13:01:18 +00:00
Noemi Erli 7b97e142d0 Backed out 12 changesets (bug 1795296, bug 1855742) as requested by aosmond a=backout
Backed out changeset 05b607c3bbe6 (bug 1795296)
Backed out changeset 7704291111b4 (bug 1855742)
Backed out changeset db60743295fb (bug 1855742)
Backed out changeset 8ed51e7d1c98 (bug 1855742)
Backed out changeset 40cba2c51b1c (bug 1855742)
Backed out changeset d4bfe15c07ec (bug 1855742)
Backed out changeset 2061271c53e8 (bug 1855742)
Backed out changeset 5b2a89a61f7f (bug 1855742)
Backed out changeset 2028c7018977 (bug 1855742)
Backed out changeset 13e806495fb8 (bug 1855742)
Backed out changeset 4bfa0d4913a2 (bug 1855742)
Backed out changeset 711b3f47e380 (bug 1855742)
2023-12-19 17:25:55 +02:00
Andrew Osmond 09f7cdee80 Bug 1855742 - Part 9. Allow CanvasDrawEventRecorder to be created on DOM workers. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D189530
2023-12-19 05:10:34 +00:00
Andrew Osmond 2cd5b292c7 Bug 1855742 - Part 1. Add/update owning thread assertions to CanvasChild/DrawEventRecorder. r=gfx-reviewers,lsalzman
This patch adds/updates the thread assertion plumbing for CanvasChild
and DrawEventRecorder to ensure that we are always accessing them on the
owning thread. It also now makes these checks compatible with running in
a DOM worker context for OffscreenCanvas using recordings.

Differential Revision: https://phabricator.services.mozilla.com/D189526
2023-12-19 05:10:31 +00:00
Markus Stange e4ba2c2700 Bug 1850357 - Use nsTHashMap in DrawEventRecorder instead of unordered_map. r=jrmuizel
On Windows, unordered_map appears to allocate memory for empty sets.

Differential Revision: https://phabricator.services.mozilla.com/D186959
2023-08-28 23:11:04 +00:00
Markus Stange 2e9dce4692 Bug 1850357 - Use nsTHashSet in DrawEventRecorder instead of unordered_set. r=jrmuizel
On Windows, unordered_set appears to allocate memory for empty sets.

Differential Revision: https://phabricator.services.mozilla.com/D186958
2023-08-28 23:11:04 +00:00
Bob Owen f2741a022a Bug 1838792: Add TryAddStoredObject to DrawEventRecorderPrivate and use in DrawTargetRecording. r=aosmond
This means we can do a combination of HasStoredObject and AddStoredObject with
only one call to ProcessPendingDeletions, which uses locking.

Differential Revision: https://phabricator.services.mozilla.com/D181963
2023-06-27 13:58:58 +00:00
Bob Owen 1f158771dd Bug 1831188: Process pending deletions in DrawEventRecorderPrivate::DetachResources. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D177095
2023-05-03 21:47:12 +00:00
Corinne R Pohl 73ee6e2b1f Bug 1829507: Fix typo in DrawEventRecorder.h. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D176220
2023-04-23 02:05:57 +00:00
Bob Owen 85d921c123 Bug 1825169: Process off main thread deletions in DrawEventRecorderPrivate::AddStoredObject. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D174952
2023-04-17 15:23:42 +00:00
Andrew Osmond b3def22e3d Bug 1728240 - Remove DrawTargetWrapAndRecord and gfx.2d.recording pref. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124000
2021-08-31 02:03:58 +00:00
Simon Giesecke 79fddefe02 Bug 708901 - Migrate to nsTHashSet in gfx/ipc. r=jrmuizel
Depends on D109316

Differential Revision: https://phabricator.services.mozilla.com/D109317
2021-03-23 10:36:37 +00:00
Bob Owen 75f69ba6de Bug 1644208: Change RecordSourceSurfaceDestruction to take a void* not SourceSurface* to avoid AddRef during destructor. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D78770
2020-06-09 14:21:31 +00:00
Bob Owen ba603ff7e1 Bug 1607630: Use ScaledFonts to track the recording lifetime of UnscaledFonts. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D73873
2020-05-19 16:09:43 +00:00
Bob Owen 261ddce4a8 Bug 1630521: Allow CanvasDrawEventRecorder to control surface destruction recording, so it can be done on the main thread. r=jrmuizel
The recording by CanvasDrawEventRecorder into the ring buffer is not thread-safe
and so must all occur on the same (main) thread.
In addition to that it sometimes needs to send IPC messages via the PCanvas
protocol, which also can only be done on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D71174
2020-04-16 17:13:16 +00:00
Simon Giesecke dce1e48caf Bug 1613985 - Use default for equivalent-to-default constructors/destructors in gfx. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D65288

--HG--
extra : moz-landing-system : lando
2020-03-04 15:39:20 +00:00
Bob Owen a92e772fe9 Bug 1590619: Only clean up Remote Canvas IPC classes when the CanvasChild owns the only recorder reference. r=jrmuizel
This also removes the DrawEventRecorderPrivate::IsEmpty method as it is no
longer used. It doesn't undo the splitting out of the tracking of the
UnscaledFonts, which was added at the same time, because I think it is useful
to highlight the fact that they are never currently removed.

Differential Revision: https://phabricator.services.mozilla.com/D51593

--HG--
extra : moz-landing-system : lando
2019-11-04 14:15:22 +00:00
Bob Owen a9a7c894d9 Bug 1582372 Part 2: Only clean up Canvas IPC objects when recorder has no stored objects. r=jrmuizel
The recorder can still contain UnscaledFonts, but they are never removed
currently, so we can't wait for them and they will be re-recorded safely anyway.

Depends on D49757

Differential Revision: https://phabricator.services.mozilla.com/D49758

--HG--
extra : moz-landing-system : lando
2019-10-29 08:34:34 +00:00
Jeff Muizelaar b01dc0a82e Bug 1584375. Remove unused origin from recording. r=nical
This was added as part of an intermediate step to blob
recoordination. It's not used anymore.

Differential Revision: https://phabricator.services.mozilla.com/D47354

--HG--
extra : moz-landing-system : lando
2019-10-02 21:47:11 +00:00
Daniel Varga f1edb8b815 Backed out changeset dfa9c9bab741 (bug 1584375) for marionette crash @ rust_begin_unwind. On a CLOSED TREE 2019-10-02 20:43:36 +03:00
Jeff Muizelaar 20983ff87e Bug 1584375. Remove unused origin from recording. r=nical
This was added as part of an intermediate step to blob
recoordination. It's not used anymore.

Differential Revision: https://phabricator.services.mozilla.com/D47354

--HG--
extra : moz-landing-system : lando
2019-10-02 16:42:24 +00:00
Jeff Muizelaar c0299a4309 Bug 1563775. Include the recording origin in the stream. r=nical
This will let us do the subtraction of the recording origin during
playback instead of during recording.

It will also let us merge recordings that have different origins.

Differential Revision: https://phabricator.services.mozilla.com/D37561

--HG--
extra : moz-landing-system : lando
2019-07-12 18:20:29 +00:00
Csoregi Natalia b798889d4a Backed out changeset 5c4b8d62324c (bug 1563775) for reftest crashes. a=backout 2019-07-12 01:17:41 +03:00
Jeff Muizelaar e146f6712d Bug 1563775. Include the recording origin in the stream. r=nical a=reland
This will let us do the subtraction of the recording origin during
playback instead of during recording.

It will also let us merge recordings that have different origins.

Differential Revision: https://phabricator.services.mozilla.com/D37561

--HG--
extra : source : cb1d78b00e25dd7fcfec86216c7a83c85ce9a982
extra : histedit_source : 68a31189f05998ba3b8a29a624d7ebe37636c4d9
2019-07-10 14:01:34 +00:00
Brindusan Cristian fd86c6d641 Backed out changeset cb1d78b00e25 (bug 1563775) on request from jrmuizel for causing Bug 1565231. a=backout 2019-07-11 17:40:51 +03:00
Jeff Muizelaar 3cc5f09011 Bug 1563775. Include the recording origin in the stream. r=nical
This will let us do the subtraction of the recording origin during
playback instead of during recording.

It will also let us merge recordings that have different origins.

Differential Revision: https://phabricator.services.mozilla.com/D37561

--HG--
extra : moz-landing-system : lando
2019-07-10 14:01:34 +00:00
Jean-Yves Avenard 11ac9e9cf8 Bug 1540581 - P6. Tidy some C++ declarations in gfx/. r=gerald,jrmuizel
* Remove redundant virtual keywords
* Mark all destructors of inheriting classes as virtual for clarity
* Mark all classes without virtual destructor as final (exposed errors)
* Make destructor virtual where it needed to be (some were missing)
* Replace empty ({}) code declaration in header with = default
* Remove virtual unused methods

I probably missed some, it quickly became a rabbit hole.

Differential Revision: https://phabricator.services.mozilla.com/D26060

--HG--
extra : moz-landing-system : lando
2019-04-11 12:36:51 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ryan Hunt fd979d2851 Bug 1475139 part 7 - Add DrawDependentSurface API to DrawTarget. r=mattwoodrow
This commit adds an API to DrawTarget to draw a surface that will be provided
at the time a recording is replayed. The surface is referenced using a user
interpreted ID.

This will be used for drawing a OOP iframe, and the ID will be the TabId.

Differential Revision: https://phabricator.services.mozilla.com/D6786

--HG--
extra : rebase_source : d5ce9b429c89e9adb0e5fb180f60125e64f12d4a
2018-09-24 21:43:41 -05:00
Lee Salzman de75729420 Bug 1480615 - reuse scaled fonts across blob image recordings. r=jrmuizel 2018-09-05 21:55:53 -04:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Andrew Osmond 63d93fdc78 Bug 1425484 - Part 3. Integrate shared surfaces with the blob image recordings. r=jrmuizel 2018-04-26 19:00:16 -04:00
Robert Longson 36466d75ed Bug 1451066 - One t in detach r=jmuizelaar
--HG--
extra : rebase_source : 00669d1975e41963a2dc030d76c7edf78fcd1593
2018-04-03 10:54:00 +03:00
Jeff Muizelaar fe9267ddda Bug 1449029. Moz2D Recording: Make Finish() return if any items. r=lsalzman
Blob image invalidation will use will use this to avoid sending empty recordings.

MozReview-Commit-ID: BlP5kqCbBys
2018-03-27 17:31:03 -04:00
Masatoshi Kimura dea129ada5 Bug 1428258 - Stop using GetNativePath in gfx/. r=jrmuizel
MozReview-Commit-ID: EdcKDRQeGXg

--HG--
extra : rebase_source : 8a6f93091e7f7cf96f998a3b8a5ce518c822f112
extra : intermediate-source : 77d4d136028337085cebdb59201302676a2ec521
extra : source : 477624377a9796459ada93719df68ba152587781
2017-12-17 00:13:30 +09:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Daniel Holbert 126bd9e1a4 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

--HG--
extra : rebase_source : c6162fa3cf539a07177a19838324bf368faa162b
2017-10-27 16:10:06 -07:00
Jeff Muizelaar ed62b1d4a1 Bug 1380014. Share fonts with WebRender. r=lsalzman
This changes the serialization format a little bit.
We now have an index at the end of the blob. This
is currently used to store a list of the used font keys.
In the future we'll add rects and can use it for invalidation.
2017-10-27 18:21:27 -04:00
Jeff Muizelaar f1e1608327 Bug 1380014. Add the ability to record UnscaledFonts by index. r=lsalzman 2017-10-27 18:21:26 -04:00
Alex Gaynor 41d8032290 Bug 1319423 - Part 1 - Introduce DrawEventRecorderPRFileDesc to allow switching away from std::ofstream in printing; r=jrmuizel
MozReview-Commit-ID: 1gn8J2fhejS

--HG--
extra : rebase_source : 02b6224c2788964c375092e58174efbacfdbdba5
2017-10-03 12:29:15 -04:00
Jeff Muizelaar 2080cabf66 Bug 1378953 - Always use unordered_set in DrawEventRecorder. r=lsalzman
We always have unordered_set now, and it's closer to what we want.
2017-07-06 16:57:04 -04:00
Jeff Muizelaar b9527d4f81 Bug 1374900. Replace CopyRecording with direct use of the memory buffer. r=lsalzman 2017-06-22 23:55:47 -04:00
Jeff Muizelaar 8e3a8d7ea1 Bug 1374900. Rewrite DrawEventRecorderMemory to use the MemStream infrastructure. r=lsalzman 2017-06-22 23:55:47 -04:00
Jeff Muizelaar 0442ca87fb Bug 1367538. Clear user data after we're done with the recorder. r=lsalzman
This helps keep us from accumulating all of the recorders.

The basic idea is to track weak references to the SourceSurfaces and Fonts that
we add UserData to in DrawEventRecorderPrivate and then clear these UserData's
when we're done recording.

This adds a RemoveAndDestroy helper to UserData to make this possible.
2017-06-09 14:31:35 -04:00
Jeff Muizelaar ec4e044d9e Bug 1360001. Add back some recording helpers. r=bobowen
These are only going to be used temporarily while we bring up blob images for
webrender.
2017-05-01 21:58:21 -04:00