Commit Graph

168 Commits

Author SHA1 Message Date
Jeff Muizelaar
73d47b32e2 Bug 1556473. Change DrawTargetD2D1::GetDeviceSpaceClipRect to always give back useful values. r=bas
Even if we have no clips applied it's valuable to give back the surface size.

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

--HG--
extra : moz-landing-system : lando
2019-06-08 03:59:19 +00:00
Jeff Muizelaar
e565bbcea6 Bug 1556470. Add a Flush() to DrawTargetD2D1::IntoLuminanceSource(). r=bas
I needed this change to make things work with my CreateClippedDrawTarget. It
seems reasonable but I can't justify it rigorously.

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

--HG--
extra : moz-landing-system : lando
2019-06-08 03:58:36 +00:00
Jeff Muizelaar
fee767003f Bug 1556505. Handle offset surfaces in the other backends. r=rhunt
This brings DrawTargetCairo and DrawTargetD2D1 inline with DrawTargetSkia's
ability to handle SourceSurfaceOffset properly.

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

--HG--
extra : moz-landing-system : lando
2019-06-03 19:08:58 +00:00
Andreea Pavel
accc389b66 Merge mozilla-inbound to mozilla-central. a=merge 2019-05-01 18:56:07 +03:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Lee Salzman
552e417755 Bug 1539026 - Skia m74 Moz2D fixes. r=rhunt 2019-03-26 11:06:56 -04:00
Bas Schouten
fea87b2298 Bug 1521774: Ensure a DC is available when using the generic dc on the main thread. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D19146

--HG--
extra : rebase_source : d7f0135c283e0ed84667d896467c26447e9c2cf8
2019-02-08 14:52:05 +01:00
Bas Schouten
296f494160 Bug 1524554: Ensure Canvas surfaces are initialized on the main thread and ensure their validity. r=rhunt
This isn't the prettiest solution but it's minimally invasive. More long-term a better solution may be to expose a call on DrawTargets to ensure their initialization even if they're on the main thread. IsValid probably isn't a good candidate for this as we want it to be usable freely on the main thread to ensure none of the basic conditions of the surface are still valid.

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

--HG--
extra : rebase_source : 2b2f05a247ea8c6896288624c5620501592e3dcc
2019-02-01 13:18:55 +01:00
Bas Schouten
d8a0c14970 Bug 1522415: Properly track initialization state in case a device reset occurs during initialization. r=rhunt
This fixes a situation where a Device Reset occurs during initialization, after mDC has already been created but before mBitmap is created. In this case IsValid and EnsureInitialized would previously return 'true' in subsequent calls, since they were only checking for the DC.

This patch makes us properly store the full result of initialization for checking with IsValid and re-runs of EnsureInitialized.

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

--HG--
extra : rebase_source : a20480486c094e14c3a2f67e5f39b1efbece5c69
2019-01-24 12:37:28 +01:00
Bas Schouten
21157ebf38 Bug 1535866: Check if a valid DeviceContext is available before attempting to use it. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D29106

--HG--
extra : rebase_source : b4ceb0281e26cc103ebd3036116576bed8653711
2019-04-27 21:01:29 +00:00
Bas Schouten
587e039c49 Bug 1521368: Forego drawing if our drawtarget is invalid, this can happen on a devicereset. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D17224

--HG--
extra : moz-landing-system : lando
2019-01-22 23:09:28 +00:00
Bas Schouten
78d819cda0 Bug 1521008: Defer OptimizeSourceSurface to the paint thread if possible. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D16943

--HG--
extra : rebase_source : 9a1899759f631e7ffd9db3cd9333540b550b3884
2019-01-18 06:45:17 +01:00
Bas Schouten
940959abd0 Bug 1520877 - Part 2: Implement FillRoundedRect for D2D. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D16893

--HG--
extra : rebase_source : 47ea1c3907578f27743a0f3543553062b76953c8
2019-01-17 20:29:43 +01:00
Bas Schouten
5c3778d6dd Bug 1519739: Attempt to create Direct2D paths on the paint thread. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D16433

--HG--
extra : rebase_source : 98c1a0461d7498d2658de54ded796025c7a0beb6
2019-01-14 01:16:17 +01:00
Bas Schouten
7cbaee9bbb Bug 1519760: Attempt to initialize D2D off the main thread as much as possible. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D16432

--HG--
extra : rebase_source : d42875e3e87c6fd756d5de192387a36a0ec2dafd
2019-01-13 23:14:33 +01: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
Kartikaya Gupta
17eea57296 Bug 1466613 - Robustify DrawTargetRecording codepaths that create new drawtargets. r=mstange
Badly-behaved consumers of DrawTargetRecording can trigger recording of
draw calls that will fail to allocate required draw targets when the
recording is replayed. This patch tries to guard against this by
detecting these situations at record-time rather than crashing at
replay-time. When such a situation is detected, it will crash (for
content processes, to catch such scenarios) or gracefully fail (for
other processes).

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

--HG--
extra : moz-landing-system : lando
2018-11-13 10:39:02 +00:00
Jean-Yves Avenard
b5f4d81b93 Bug 1497294 - P2. Move type related constant methods to Types.h r=nical
The methods BytesPerPixel, SurfaceFormatForColorDepth, BitDepthForColorDepth, ColorDepthForBitDepth and RescalingFactorForColorDepth all directly depends on the types defined in Types.h, they also return constant values.

As such it makes more sense to have them defined at the same level where the types themselves are declared.

Depends on D8065

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

--HG--
extra : moz-landing-system : lando
2018-10-09 12:56:25 +00:00
Jean-Yves Avenard
16852a7fe4 Bug 1495025 - P7. Silence compilation warning r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D7977

--HG--
extra : moz-landing-system : lando
2018-10-08 18:57:58 +00:00
Jamie Nicol
35e92591dd Bug 1474883 - Ensure D2D glyph cache is pruned after rendering 1000 transformed glyphs. r=bas
Rendering glyphs at many different rotations was causing the D2D glyph
cache to grow very large. Calling EndDraw/BeginDraw will prune the
cache, but is costly, so only do it for every 1000 glyphs.

MozReview-Commit-ID: HUFpxDvYAzQ

--HG--
extra : rebase_source : de283c5e687da07e5417e0d221d7f45b992080d5
2018-07-26 15:23:19 +01:00
Matt Woodrow
9171c79a67 Bug 1372458 - Fold opacity into filter drawing rather than using a temporary surface. r=bas,mstange
MozReview-Commit-ID: GOBTUhN7fcC

--HG--
extra : rebase_source : 8355d2001dcc8fba5e43d4ace6483896a9d9cd31
2018-07-14 15:25:49 +12:00
Bas Schouten
2c2327c372 Bug 1427063: Have D2D interpret colors in premultiplied space. As it says is its default. r=rhunt
MozReview-Commit-ID: 5OWjHW1CqjN
2018-04-23 19:27:48 +02:00
Lee Salzman
ff2a78845b Bug 1448667 - use ColorMatrix effect instead of LuminanceToAlpha effect for DrawTargetD2D1::IntoLuminanceSource. r=bas
MozReview-Commit-ID: LHbSiFBx6HK
2018-04-05 14:07:18 -04:00
Bas Schouten
7f06948838 Bug 1425257: Introduce a global lock to protect the dependency graph between DrawTargets. r=lsalzman
This patch takes the safest route for securing modifications to the dependency graph for D2D DrawTargets. It's possible a slightly optimal approach is possible, however lock contention should be rare and I believe this is the safest and most upliftable approach.

MozReview-Commit-ID: HGfSdEp2U5N
2018-02-06 03:08:04 +01:00
Margareta Eliza Balazs
9c4eafffee Backed out changeset 0c3400afa45f (bug 1425257) for failing R-e10s in slave/test/build/tests/reftest/tests/image/test/reftest/pngsuite-basic-n/basn0g01.png on a CLOSED TREE 2018-02-06 07:27:43 +02:00
Bas Schouten
bf22a1874d Bug 1425257: Introduce a global lock to protect the dependency graph between DrawTargets. r=lsalzman
This patch takes the safest route for securing modifications to the dependency graph for D2D DrawTargets. It's possible a slightly optimal approach is possible, however lock contention should be rare and I believe this is the safest and most upliftable approach.

MozReview-Commit-ID: HGfSdEp2U5N
2018-02-06 03:08:04 +01:00
Milan Sreckovic
099cfc4242 Bug 1423570: Use BaseRect access methods instead of member variables in gfx/ r=bas.schouten
MozReview-Commit-ID: ZGySgc9oP3

--HG--
extra : rebase_source : 23aadc10e9885002290155684b2c495780d979ce
2017-12-19 15:48:39 -05:00
peter chang
f735c3d7f1 Bug 1418791 - Ensure mSnapshot access is protected by mutex, r=dvander
MozReview-Commit-ID: 3NPzv6VftxZ

--HG--
extra : rebase_source : 2af00974d4de8d0cc15a326520111c32c4437b54
2017-12-05 15:35:16 +08:00
David Anderson
4d9d8d5d59 Bug 1416864 - Synchronize how snapshots detach in DrawTargetD2D1. r=bas 2017-11-21 10:52:38 -05:00
Markus Stange
78303f13ce Bug 1414154 - Remove GlyphRenderingOptions. r=lsalzman
MozReview-Commit-ID: JtwnTj1hhPV

--HG--
extra : rebase_source : 2a3e896eec8b6839097baf6e2cccc10eb162827b
2017-11-02 21:42:56 -04:00
David Anderson
cf84c3f01d Add SourceSurfaceCapture to avoid main-thread rasterization with temporary DrawTargetCaptures. (bug 1395478 part 6, r=rhunt)
--HG--
extra : rebase_source : 3a3841e5a54f9780720a543ee792f501b5150b02
2017-10-31 12:02:31 -07: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
Bas Schouten
576b1d0c7d Bug 1392453: Allow a small amount of list-in-list drawing commands. r=mchang
MozReview-Commit-ID: H4w5gPVOhwg
2017-09-22 19:37:02 +02:00
Bas Schouten
973de6713e Bug 1400573: Back out initial fix for bug 1392453. r=mchang
MozReview-Commit-ID: 3c3vJbL4kXS
2017-09-20 14:57:25 +02:00
Bas Schouten
2d48dc6667 Bug 1392453: Allow limiting the blend surface area and the portion of the layer being resolved. r=mchang
This introduces the infrastructure to specify the bounds of drawing commands being executed. These bounds can then be used to limit operations done for blending in order to reduce required fillrate. Currently we only specify the bounds for DrawSurface but it would be easy to extend this for other drawing commands if so desired.

MozReview-Commit-ID: BUFJzphfdKc

--HG--
extra : rebase_source : cbd17803d8aeb1a74b6c7c98fd5c00e06870805b
2017-09-12 19:10:55 +00:00
Milan Sreckovic
e3cd0a3157 Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in .cpp files in gfx/*. r=milan
MozReview-Commit-ID: 1jESowJKdyp

--HG--
extra : rebase_source : 3839cdea46729a9af05c777215cffcb9f42a2018
2017-08-14 08:29:28 -04:00
David Anderson
d91f1ac58c Protect D2D singletons with a mutex. (bug 1380922 part 2, r=mchang)
--HG--
extra : rebase_source : f261e84d8d6a9ef7d153b04d447f9edb36a77dde
2017-07-18 12:15:44 -07:00
David Anderson
e53986168f Store and return D2D singletons in RefPtrs. (bug 1380922 part 1, r=mchang)
--HG--
extra : rebase_source : baf7cce201a38897f1f9dcbd7c36855ff070217b
2017-07-18 12:15:39 -07:00
Lee Salzman
2d696d5c34 Bug 1376026 - fix plumbing of DWrite parameters for Skia fonts to not depend on gfxPlatform. r=jrmuizel
MozReview-Commit-ID: 5K9201eCSv
2017-06-30 14:09:05 -04:00
Sebastian Hengst
522fc18c93 Backed out changeset 24421d72ba08 (bug 1376026) 2017-07-07 21:42:09 +02:00
Lee Salzman
ab6885d706 Bug 1376026 - fix plumbing of DWrite parameters for Skia fonts to not depend on gfxPlatform. r=jrmuizel
MozReview-Commit-ID: 5K9201eCSv
2017-06-30 14:09:05 -04:00
Carsten "Tomcat" Book
fbc9f302f1 Backed out changeset d09fb3a5cedf (bug 1376026) 2017-07-06 08:11:48 +02:00
Lee Salzman
edc6db4195 Bug 1376026 - fix plumbing of DWrite parameters for Skia fonts to not depend on gfxPlatform. r=jrmuizel 2017-06-30 14:09:05 -04:00
Mason Chang
d59c1c2657 Bug 1372577. Fallback to CPU alpha to luminance on the parent process. r=jrmuizel 2017-06-29 10:09:14 -07:00
Mason Chang
d69917e056 Bug 1375452 Fallback to DrawTarget::IntoLuminance if we can't create the effect. r=jrmuizel 2017-06-22 10:15:37 -07:00
Jeff Muizelaar
cf6d4425f4 Bug 1359527. Fixup DrawTarget::IntoLuminance mismerge. r=mchang
This adds back the NEON code and fixes up a couple of other pieces
2017-06-09 10:57:44 -04:00
Mason Chang
1520cb158b Bug 1359527. Part 1 - Add DrawTarget::IntoLuminance r=jrmuizel 2017-06-02 11:13:36 -07:00
Mason Chang
17ccdaf65c Bug 1369096 - Check HRESULT when QueryInterfacing an ID2D1Image for an ID2D1Bitmap. r=bas 2017-05-30 15:59:19 -07:00
Mason Chang
d73beaa757 Bug 1367127 - Use an ImageBrush during DrawTargetD2D1::PushLayer instead of a BitmapBrush. r=bas 2017-05-30 09:31:02 -07:00
Phil Ringnalda
16b90e808a Backed out changeset e12fa325e112 (bug 1359527) for Win8 masking reftest failures
MozReview-Commit-ID: 5ecOfTu606d
2017-05-28 15:45:42 -07:00