Commit Graph

3063 Commits

Author SHA1 Message Date
Christian Holler
4ce6f81fee Bug 1431090 - Prepare tools/fuzzing/ to be used with JS_STANDALONE. r=froydnj
This patch adjusts tools/fuzzing/ in such a way that the relevant parts can be
reused in the JS engine. Changes in detail include:

* Various JS_STANDALONE checks to exclude parts that cannot be included in
  those builds.

* Turn LibFuzzerRegistry and LibFuzzerRunner into generic FuzzerRegistry and
  FuzzerRunner classes and use them for AFL as well. Previously, AFL was
  piggy-backing on gtests which was kind of an ugly solution anyway (besides
  that it can't work in JS). Now more code like registry and harness is
  shared between the two and they follow almost the same call paths and entry
  points. AFL macros in FuzzingInterface have been rewritten accordingly.
  This also required name changes in various places. Furthermore, this unifies
  the way, the fuzzing target is selected, using the FUZZER environment
  variable rather than LIBFUZZER (using LIBFUZZER in browser builds will give
  you a deprecation warning because I know some people are using this already
  and need time to switch). Previously, AFL target had to be selected using
  GTEST_FILTER, so this is also much better now.

* I had to split up FuzzingInterface* such that the STREAM parts are in a
  separate set of files FuzzingInterfaceStream* because they use nsStringStream
  which is not allowed to be included into the JS engine even in a full browser
  build (error: "Using XPCOM strings is limited to code linked into libxul.").
  I also had to pull FuzzingInterface.cpp (the RAW part only) into the header
  and make it static because otherwise, would have to make not only separate
  files but also separate libraries to statically link to the JS engine, which
  seemed overkill for a single small function. The streaming equivalent of the
  function is still in a cpp file.

* LibFuzzerRegister functions are now unique by appending the module name to
  avoid redefinition errors.

MozReview-Commit-ID: 44zWCdglnHr

--HG--
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.cpp => tools/fuzzing/interface/harness/FuzzerRunner.cpp
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.h => tools/fuzzing/interface/harness/FuzzerRunner.h
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h => tools/fuzzing/interface/harness/FuzzerTestHarness.h
rename : tools/fuzzing/libfuzzer/harness/moz.build => tools/fuzzing/interface/harness/moz.build
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.cpp => tools/fuzzing/registry/FuzzerRegistry.cpp
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.h => tools/fuzzing/registry/FuzzerRegistry.h
extra : rebase_source : 7d0511ca0591dbf4d099376011402e063a79ee3b
2018-01-17 15:20:35 +01:00
Gurzau Raul
76ec8a476e Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-01-20 11:46:16 +02:00
Boris Zbarsky
9ee8c16efe Bug 1431774 part 1. Remove a bunch of unnecessary QIs to nsIImageLoadingContent in JS. r=mystor
These are all no-ops because the objects involved are already implementing one of the WebIDL interfaces that pulls in MozImageLoadingContent, and that's all script gets to see.

MozReview-Commit-ID: Io2mLHbv7qM
2018-01-19 14:19:39 -05:00
Valentin Gosu
ea4e6b68ff Bug 1431204 - Make nsIURI.spec readonly r=mayhemer
MozReview-Commit-ID: 1l1CBUotIPh

--HG--
extra : rebase_source : 92af70ad412719d93222551b658f313cefd85e75
2018-01-19 15:26:07 +01:00
Valentin Gosu
89445898bd Bug 1431204 - Only addref the mutator if is not null r=mayhemer
MozReview-Commit-ID: 94VsIsLxx2T

--HG--
extra : rebase_source : 3608e624bd8dce13ac7a5dac45a3522b3b685460
2018-01-19 15:26:03 +01:00
Valentin Gosu
da90b10e9f Bug 1431204 - Change calls to nsIURI.spec setter to use nsIURIMutator instead r=mayhemer
* changes call to use nsIURIMutator.setSpec()
* Add new NS_MutateURI constructor that takes new Mutator object
* Make nsSimpleNestedURI::Mutate() and nsNestedAboutURI::Mutate() return mutable URIs
* Make the finalizers for nsSimpleNestedURI and nsNestedAboutURI make the returned URIs immutable

MozReview-Commit-ID: 1kcv6zMxnv7

--HG--
extra : rebase_source : 99b13e9dbc8eaaa9615843b05e1539e19b527504
2018-01-19 15:19:42 +01: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
Sylvestre Ledru
424664ff30 Bug 1278282 - Remove the 'MOZ_WIDGET_GTK == 2' defines r=karlt,lsalzman
MozReview-Commit-ID: 3v8D600g8St

--HG--
extra : rebase_source : 34ea6f9868c1b322076c24daa75dc33e27b6704e
2018-01-10 08:52:04 +01:00
Ciure Andrei
f7400ad72e Merge inbound to mozilla-central r=merge a=merge 2018-01-11 11:54:56 +02:00
Kate McKinley
e97980a95e Bug 1424917 - Remove support for HSTS Priming. r=mayhemer, r=ckerschb
This patch removes support and tests for HSTS priming from the tree.
2018-01-10 11:07:00 -05:00
Kartikaya Gupta
2554bc3dd5 Bug 1429469 - Remove a bunch of fails-if(webrender) annotations. r=jrmuizel
All of these tests have existing fuzzy annotations which cover the
differences in the WR renderings. Therefore we can remove the
fails-if(webrender) annotations and use the existing fuzzy annotations
to treat the tests as passing.

MozReview-Commit-ID: LFWha6gAP2r

--HG--
extra : rebase_source : b26a0d0cd66b6bab273251e6a2de9210417ba798
2018-01-10 13:34:14 -05:00
Masatoshi Kimura
8b05ff3704 Bug 1427023 - Remove nsCRT::strncmp. r=erahm 2018-01-09 23:49:37 +09:00
Milan Sreckovic
d0d070b48c Bug 1423567: Use BaseRect access methods instead of member variables in image/ r=aosmond
MozReview-Commit-ID: JNYZsts6pCO

--HG--
extra : rebase_source : d37ce77ec84af302018f95285cff61b2ba28c957
2017-12-20 16:46:28 -05:00
Florian Quèze
0f55cd45be Bug 1421992 - script-generated patch to replace do_execute_soon, do_print and do_register_cleanup with executeSoon, info and registerCleanupFunction, rs=Gijs. 2017-12-21 11:10:23 +01:00
Florian Quèze
032c961e0a Bug 1421992 - script-generated patch to replace do_check_* functions with their Assert.* equivalents, rs=Gijs. 2017-12-21 11:08:17 +01:00
Ben Kelly
0240c2751f Bug 1426253 P3 Use the window/document GetController() method. r=asuth 2017-12-20 10:53:18 -05:00
Timothy Nikkel
3a0af70d3f Bug 1404366. Convert the image data for BMPs inside ICOs that has a mask to premultiplied alpha as expected. r=aosmond
If we aren't using a downscaler we avoid this bug because the mask is either 100% transparent or 100% opaque, and in the transparent case we just set the whole pixel (32 bits) to 0.

But when we are using a downscaler we just replace the alpha values in the original surface (leaving the color values untouched).

We need to go the full premultiply route because after downscaling the mask we can have any value for alpha instead of just 0 or 255.
2017-12-20 01:02:57 -06:00
Andrew Osmond
5124576b71 Bug 1415547 - Add SurfaceCache gtests for factor of 2 mode. r=tnikkel 2017-12-19 16:45:08 -05:00
Gijs Kruitbosch
3c59d52401 Bug 1424261, r=valentin
--HG--
extra : rebase_source : 9f4c9c619dbccc2575b2a9d3e4304a54d41acad5
2017-12-12 10:53:50 -06:00
Kartikaya Gupta
4f18e92ffb Bug 1334189 - Enable mochitest-plain for linux64-qr. r=jrmuizel
MozReview-Commit-ID: nbcWhDq5de

--HG--
extra : rebase_source : 25e2c2b8b996ae11cd25dee07d9092ba574a9e40
2017-12-13 18:38:39 -05:00
Samathy Barratt
d8ba79a56b Bug 1351447 - Rename imagelib's DrawResult to ImgDrawResult r+tnikkel r=tnikkel
Renamed to imgDrawResult

MozReview-Commit-ID: 5ESSgIhhU41

--HG--
rename : image/DrawResult.h => image/ImgDrawResult.h
extra : rebase_source : dbf645574aff7eefe65fa81809d6c07cb5800ec6
2017-12-11 15:37:59 +00:00
Ciure Andrei
b8d4330b53 Backed out changeset 8e33d0ce108c (bug 1351447) for failing /builds/worker/workspace/build/src/widget/cocoa/nsCocoaUtils on OS X r=backout a=backout on a CLOSED TREE
--HG--
rename : image/ImgDrawResult.h => image/DrawResult.h
2017-12-12 09:49:59 +02:00
Samathy Barratt
0749baf2d8 Bug 1351447 - Rename imagelib's DrawResult to ImgDrawResult r=tnikkel
Renamed to imgDrawResult

MozReview-Commit-ID: 5ESSgIhhU41

--HG--
rename : image/DrawResult.h => image/ImgDrawResult.h
extra : rebase_source : 4fba109b84ef456126d50e0d5e525f29f944a46d
2017-12-11 15:37:59 +00:00
Sylvestre Ledru
9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Eric Rahm
07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
Andrew Osmond
d84d324b49 Bug 1419889 - Don't force the image cache to validate if it hasn't started yet. r=tnikkel
imgLoader::ValidateEntry would aggressively determine an entry has
expired, even when the request hasn't yet begun. This is because the
expiration time for the entry was not set unless it was for a channel
which supports caching. Now we set the expiration time for all
channels, and if it doesn't support caching, it just expires at the
current time when imgRequest::OnStartRequest is called. Additionally,
imgLoader::ValidateEntry will not consider the expiration time in the
entry until it is non-zero.
2017-12-07 08:28:28 -05:00
Jonathan Watt
074c9f99da Bug 1422979, part 2 - Update the bmpsuite test suite to version 2.5. r=njn 2017-12-01 23:45:17 +00:00
Jonathan Watt
67dfd1dd00 Bug 1422979, part 1 - Increase bmpsuite reftest fuzz for HiDPI. r=njn 2017-11-30 13:43:15 +00:00
Valentin Gosu
5a83d2bc0b Bug 1420954 - Make nsIURIMutator setters return nsIURIMutator so we can chain setters r=bagder
MozReview-Commit-ID: 53BD91hB2yi

--HG--
extra : rebase_source : 3c4f5b9ad8820353ae108b982026048dbf599d95
2017-12-05 02:35:21 +01:00
shindli
7ba06ee564 Backed out 2 changesets (bug 1420954) for build failure in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsIURIMutator.h:340:3: r=backout on a CLOSED TREE
Backed out changeset 8ce0a0d49d9e (bug 1420954)
Backed out changeset 480c6e1721e9 (bug 1420954)
2017-12-03 01:10:14 +02:00
Valentin Gosu
f903a38639 Bug 1420954 - Make nsIURIMutator setters return nsIURIMutator so we can chain setters r=bagder
MozReview-Commit-ID: 53BD91hB2yi

--HG--
extra : rebase_source : 45594a92e1a9f18f2f4b5bb2824b5f8ced584eab
2017-12-02 23:09:34 +01:00
Andrew Osmond
bcc8e2d1f7 Bug 1420245 - When getting the current frame of a VectorImage, eliminate any unnecessary draws. r=tnikkel 2017-12-01 18:50:07 -05:00
Andrew Osmond
b51de32973 Backed out changeset 09ce12f88ca8 (bug 1420245) for test breakage on a CLOSED TREE. 2017-12-01 11:29:16 -05:00
Andrew Osmond
c30a42b529 Bug 1420245 - When getting the current frame of a VectorImage, eliminate any unnecessary draws. r=tnikkel 2017-12-01 07:00:20 -05:00
Andrew Osmond
59aeaef70a Bug 1419912 - Part 2. Ensure the decoders invalidate the surface as written to. r=tnikkel 2017-12-01 06:59:21 -05:00
Gijs Kruitbosch
e77ee731e9 Bug 1222924 - stop allowing webpages to link to moz-icon: , r=mrbkap
MozReview-Commit-ID: FKEDboWIfFQ

--HG--
extra : rebase_source : 801317b5746c6e84431c6a8f2097b83523646016
2017-11-22 21:31:41 +00:00
Andrea Marchesini
b4057b86a1 Bug 1421655 - Renaming imgITools::decodeImageBuffer to imgITools::decodeImageFromBuffer, r=aosmond 2017-11-30 14:48:47 +01:00
Andrea Marchesini
16d9ec6e44 Bug 1421655 - Implementation of imgITools::decodeImageFromArrayBuffer, r=aosmond 2017-11-30 14:48:47 +01:00
Timothy Nikkel
9468c9b03a Bug 1421191. In ConvolutionFilter::ComputeResizeFilter calculate the src pixel every loop iteration. r=lsalzman
If we try to be clever and increment by invScale then floating point inaccuracies can accumulate leaving srcPixel far off from where it should be.
2017-11-29 02:22:53 -06:00
Jesse Schwartzentruber
5b3e545888 Bug 1419798 - Only build fuzzing interfaces if clang or AFL compilers are used. r=glandium
MozReview-Commit-ID: H1I9wdqTV4n

--HG--
extra : rebase_source : 18eb2536a5db80c585828ae44329f1a00d82209a
2017-11-22 11:21:09 -05:00
Andrea Marchesini
2ef23c7ade Bug 1420223 - createImageBitmap must work with nsIAsyncInputStream - part 4 - ImageBitmap must use imgITools::decodeImageBuffer, r=aosmond 2017-11-27 17:05:57 +01:00
Andrea Marchesini
75e88377d9 Bug 1420223 - createImageBitmap must work with nsIAsyncInputStream - part 2 - imgITools::decodeImageAsync, r=aosmond 2017-11-27 17:05:57 +01:00
Andrew Osmond
675137dd9f Bug 1419767 - Remove gfxPlatform::CanRenderContentToDataSurface. r=nical
Factory::DoesBackendSupportDataDrawtarget already fulfills the same
purpose and we should use that instead, as imgFrame is the only user of
the former API. It has the added bonus of allowing us to use shared
surfaces on Linux with WebRender, and using volatile surfaces on Windows
when D2D is disabled.
2017-11-24 08:10:03 -05:00
Andrew Osmond
9472bdfa62 Bug 1418895 - VectorImage::Draw should imply FLAG_BYPASS_SURFACE_CACHE for DrawTargetRecording. r=tnikkel 2017-11-23 18:14:52 -05:00
Tiberius Oros
da0a72a9d7 Merge inbound to mozilla-central r=merge a=merge 2017-11-24 00:28:29 +02:00
Valentin Gosu
c9679ad237 Bug 1419780 - nsIconProtocolHandler parses a URI twice unnecessarily r=Gijs,tnikkel
MozReview-Commit-ID: BHL8zJnShft

--HG--
extra : rebase_source : 00e0e5e5fe3dc364802232f140d0da10e6f2d7d0
2017-11-23 12:26:04 +01:00
Timothy Nikkel
8bb6a64726 Bug 1413762. Check integer shift value is reasonable before using it in gif decoder. r=aosmond 2017-11-23 00:40:17 -06:00
Andrea Marchesini
ad64933e5a Bug 1419382 - Moving ownership of nsIInputStream when using netUtil functions - part 2 - NS_NewInputStreamChannel, r=smaug 2017-11-22 11:18:36 +01:00
Timothy Nikkel
e90c0fb0e0 Bug 1419608. Make SurfaceKey::SVGContext return a reference instead of a copy. r=decoder
MozReview-Commit-ID: Cuee03ukO0k

--HG--
extra : histedit_source : 6c94447e6864ae2a637c723461b707720ec9effc
2017-11-22 01:41:35 +01:00
Samael Wang
326d642792 Bug 1406253 - Part 1: Rename imgIRequest.currentURI to finalURI to prevent confusion. r=bz
The "current URL" in the spec:
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-currentsrc
maps to imgIRequest.URI, not currentURI.

Rename imgIRequest.currentURI to finalURI to prevent such confusion.

MozReview-Commit-ID: CjBh2V4z8K9

--HG--
extra : rebase_source : 01277d16ef12845e12cc846f9dd4a21ceeca283b
2017-11-13 16:31:24 +08:00
Valentin Gosu
d2d8524673 Bug 1415205 - Add nsIURIMutator impls for all objects implementing nsIURI r=bagder
This also changes URIUtils.cpp:DeserializeURI() to use the mutator to instantiate new URIs, instead of using their default constructor.

MozReview-Commit-ID: JQOvIquuQAP

--HG--
extra : rebase_source : e146624c5ae423f7f69a738aaaafaa55dd0940d9
2017-11-20 17:11:30 +01:00
Noemi Erli
e90c67896c Backed out 3 changesets (bug 1406253)for build bustage in dom/base/nsCopySupport.cpp r=backout on a CLOSED TREE
Backed out changeset 284f3cc2880c (bug 1406253)
Backed out changeset aecb3d509a39 (bug 1406253)
Backed out changeset 9ce01198e8a1 (bug 1406253)
2017-11-20 13:34:29 +02:00
Samael Wang
a22b447e84 Bug 1406253 - Part 1: Rename imgIRequest.currentURI to finalURI to prevent confusion. r=bz
The "current URL" in the spec:
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-currentsrc
maps to imgIRequest.URI, not currentURI.

Rename imgIRequest.currentURI to finalURI to prevent such confusion.

MozReview-Commit-ID: CjBh2V4z8K9

--HG--
extra : rebase_source : d3047aed22f116ff9a74099b646a84e597388673
2017-11-13 16:31:24 +08:00
Andrew Osmond
19e321eb9e Bug 1366097 - Part 8. Improve image memory reports to include SVG context information. r=tnikkel 2017-11-17 14:08:52 -05:00
Andrew Osmond
2278b250dc Bug 1366097 - Part 7. VectorImage::Show should delegate to ImageResource::NotifyDrawingObservers. r=tnikkel 2017-11-17 14:08:52 -05:00
Andrew Osmond
b257c6e489 Bug 1366097 - Part 6. Restrict use of SVGImageContext in VectorImage::GetImageContainerAtSize to permitted URIs. r=tnikkel 2017-11-17 14:08:52 -05:00
Andrew Osmond
114b8069b3 Bug 1366097 - Part 5. Add an SVGImageContext parameter to imgIContainer::GetImageContainerAtSize. r=tnikkel 2017-11-17 14:08:52 -05:00
Andrew Osmond
c6bd7fcdf9 Bug 1366097 - Part 4. Mark VectorImage as surface as shared when used outside an image layer. r=tnikkel
This is important because it ensures we release the shared memory handle
(although not the data itself) for the underlying surface buffer when it
turns out we will probably never need to share it. If we do need to
share the surface data with the GPU process, it will reallocate a handle
if necessary, and close it when it is finished. On some platforms we
only have a finite number of handles, so if we don't need them, we
should close them.
2017-11-17 14:08:52 -05:00
Andrew Osmond
c94d4d3f78 Bug 1366097 - Part 3. Implement VectorImage::GetImageContainerAtSize and VectorImage::IsImageContainerAvailableAtSize. r=tnikkel
This is largely trivial because the meat of the implementation is
located in ImageResource and we already added GetFrameInternal.
Interestingly VectorImage::IsUnlocked does not actually check if the
image is locked, but instead only checks for animation consumers. This
is consistent with its historical behavior on when to issue an unlocked
draw event.

Note that we do not implement the original GetImageContainer and
IsImageContainerAvailable APIs. This is because the former does not
accept an SVG context and it would be best to discourage its use in old
code lest we get incorrect/unexpected results.
2017-11-17 14:08:52 -05:00
Andrew Osmond
e4a6ddc142 Bug 1366097 - Part 2. Implement VectorImage::GetFrameInternal as required by ImageResource for image containers. r=tnikkel
No functional change aside from the implementation from
VectorImage::GetFrameAtSize being repurposed for GetFrameInternal and
returning an additional error code with the surface.
2017-11-17 14:08:52 -05:00
Andrew Osmond
3f61fdab9e Bug 1366097 - Part 1. VectorImage::GetFrameAtSize should not create a DrawTarget if using cached surface. r=tnikkel
Creating a DrawTarget can be an expensive operation. This is especially
true in this case because checking for a cached already decoded version
of the VectorImage is expected to be fast. Currently VectorImage::Draw
is the typical path to render these images, but in the future, getting
the frames directly or indirectly (through an ImageContainer) will
become more common.
2017-11-17 14:08:51 -05:00
Andrew Osmond
d9067a16fe Bug 1368776 - Part 17. Fix how we could reuse an incorrect image container instead of creating a new one. r=me 2017-11-17 07:54:50 -05:00
Andrew Osmond
5418665096 Bug 1368776 - Part 16. Ensure we more consistently pass the suggested size from SurfaceCache::LookupBestMatch. r=tnikkel
The suggested size is useful in more situations now that
GetImageContainerImpl requires it. It should be passed whenever we have
it available.
2017-11-17 06:45:28 -05:00
Andrew Osmond
0cfb7cd99e Bug 1368776 - Part 15. Cache flags passed to ImageResource::GetImageContainerImpl for consistency. r=tnikkel
When FLAG_HIGH_QUALITY_SCALING is used, we need to make sure we continue
using that flag when we update the container. We should also use it for
comparing whether or not an existing image container is equivalent.
2017-11-17 06:45:28 -05:00
Andrew Osmond
addb00a059 Bug 1368776 - Part 14. Make ImageResource::GetImageContainerImpl handle differing suggested sizes. r=tnikkel 2017-11-17 06:45:27 -05:00
Andrew Osmond
a1d47a973a Bug 1368776 - Part 13. Make ImageResource::GetFrameInternal also return the suggested size for the lookup. r=tnikkel 2017-11-17 06:45:27 -05:00
Andrew Osmond
2463bc3782 Bug 1368776 - Part 12. Add gtests for RasterImage::GetImageContainerAtSize. r=tnikkel 2017-11-17 06:45:27 -05:00
Andrew Osmond
8fa46b5099 Bug 1368776 - Part 11. Add ImageResource::GetImageContainerSize to determine the appropriate size for a requested container. r=tnikkel 2017-11-17 06:45:26 -05:00
Andrew Osmond
a594e125e0 Bug 1368776 - Part 10. Implement RasterImage::IsImageContainerAvailableAtSize and GetImageContainerAtSize. r=tnikkel 2017-11-17 06:45:26 -05:00
Andrew Osmond
d6a6987766 Bug 1368776 - Part 9. Expose getting an image container at a given size. r=tnikkel
This adds IsImageContainerAvailableAtSize and GetImageContainerAtSize to
the imgIContainer interface, as well as stubbing it for all of the
classes which implement it. The real implementations will follow for the
more complicated classes (RasterImage, VectorImage).
2017-11-17 06:45:26 -05:00
Andrew Osmond
5f57793c54 Bug 1368776 - Part 8. Fix ImageResource::GetImageContainerImpl assert to allow high quality scaling. r=tnikkel 2017-11-17 06:45:26 -05:00
Andrew Osmond
a01ef792f6 Bug 1368776 - Part 7. Remove size parameter from ImageResource::UpdateImageContainer. r=tnikkel 2017-11-17 06:45:25 -05:00
Andrew Osmond
634060f444 Bug 1368776 - Part 6. Add support for multiple differently-sized image containers for downscale-on-decode. r=tnikkel
Exposure of this functionality comes in a later patch in the set.
Experimental testing with WebRender and image layers enabled suggests
most of the time we are not using more than one image container per
image, hence why mImageContainers has room for one container without a
malloc.
2017-11-17 06:45:25 -05:00
Andrew Osmond
53cb3aad32 Bug 1368776 - Part 5. Refactor ImageResource::GetCurrentImage to reduce code duplication. r=tnikkel 2017-11-17 06:45:25 -05:00
Andrew Osmond
8dcbfe2c0b Bug 1368776 - Part 4. Handle all potential DrawResult values to make Image::GetImageContainerImpl more generic. r=tnikkel
RasterImage::GetCurrentImage can only return a subset of the DrawResult
values, and the original RasterImage::GetImageContainer implementation
relied upon this behavior. Now we handle them all to ensure that when
other image implementations reuse it, they may return any valid
DrawResult and get the expected results.
2017-11-17 06:45:25 -05:00
Andrew Osmond
0b4ae23fa1 Bug 1368776 - Part 3. Move RasterImage::GetCurrentImage to ImageResource. r=tnikkel
As part of the move, we add a IntSize parameter to
ImageResource::GetCurrentImage. This is because we don't have access to
the image's size (yet) from ImageResource, but additionally because we
will need this anyways when we support multiple image containers at
different sizes.
2017-11-17 06:45:24 -05:00
Andrew Osmond
6367b2724a Bug 1368776 - Part 2. Move RasterImage::GetImageContainer and UpdateImageContainer implementations to ImageResource. r=tnikkel
The only change to the moved implementation is that we no longer have
access to RasterImage::mHasSize and RasterImage::mSize. Thus we rely
upon imgIContainer::IsImageContainerAvailable to perform these checks.
2017-11-17 06:45:24 -05:00
Andrew Osmond
b43a2010d4 Bug 1368776 - Part 1. Move RasterImage's ImageContainer state to ImageResource. r=tnikkel
This state will eventually be used by VectorImage when it supports image
containers. For now, it is harmless beyond using slightly more memory
for SVGs.
2017-11-17 06:45:23 -05:00
Andrew Osmond
37395798ee Bug 1368776 - Part 0. Move RasterImage's NotifyDrawingObservers to ImageResource. r=tnikkel 2017-11-17 06:45:23 -05:00
Brindusan Cristian
d0a4ab96a0 Merge inbound to mozilla-central r=merge a=merge 2017-11-16 00:24:15 +02:00
Valentin Gosu
a77a5282f4 Bug 1416343 - Mark URI interfaces as [builtinclass] r=bagder
MozReview-Commit-ID: 4T0uCkHP1a6

--HG--
extra : rebase_source : fa720f35df16985bcd929a98aeeaf9fbc759c1e6
2017-11-15 13:34:23 +01:00
Margareta Eliza Balazs
3edf7872fb Backed out changeset cfe4b1e6be9b (bug 1416343) for ESlint failing in modules/test/browser/browser_SitePermissions_tab_urls.js:38:14 r=backout on a CLOSED TREE 2017-11-15 13:46:07 +02:00
Valentin Gosu
ba207f8c8c Bug 1416343 - Mark URI interfaces as [builtinclass] r=bagder
MozReview-Commit-ID: 4T0uCkHP1a6

--HG--
extra : rebase_source : 89c283360bc0b30aad34641b4cdce8f5c49615b3
2017-11-13 20:18:46 +01:00
Andrew Osmond
a230c70963 Bug 1416774 - Ensure that imgRequestProxy::CancelAndForgetObserver removes itself from the cache validator. r=tnikkel
An imgRequestProxy may defer notifications when it needs to block on an
imgCacheValidator. It may also be cancelled before the validator has
completed its operation, but before this change, we did not remove the
request from the set of proxies, imgCacheValidator::mProxies. When the
deferral was completed, it would assert to ensure each proxy was still
expecting a deferral before issuing the notifications. Cancelling a
request can actually reset that state, which means we fail the assert.

Failing the assert is actually harmless; in release we suffer no
negative consequences as a result of this sequence of events. Now we
just remove the proxy from the validator set to avoid asserting.
2017-11-14 12:02:59 -05:00
Kartikaya Gupta
00ef028ed3 Bug 1416267 - Update gfxContext matrix functions to avoid flip-flopping between float and double matrices. r=jrmuizel
The core of this change is in gfxContext.*:
- change gfxContext::CurrentMatrix() and gfxContext::SetMatrix() to
  return and take a Matrix respectively, instead of converting to
  and from a gfxMatrix (which uses doubles). These functions therefore
  will now match the native representation of the transform in gfxContext.
- add two new functions CurrentMatrixDouble() and SetMatrixDouble() that
  do what the old CurrentMatrix() and SetMatrix() used to do, i.e.
  convert between the float matrix and the double matrix.

The rest of the change is just updating the call sites to avoid round-
tripping between floats and doubles where possible. Call sites that are
hard to fix are migrated to the new XXXDouble functions which preserves
the existing behaviour.

MozReview-Commit-ID: 5sbBpLUus3U
2017-11-10 21:14:09 -05:00
Jonathan Watt
7c5d39a558 Bug 1417021 - Fix various non-unified build errors in imagelib. r=aosmond 2017-10-24 23:22:55 +01:00
David Anderson
9575a22267 Remove trivial calls to DataSourceSurface::Stride. (bug 1405390 part 3, r=bas)
--HG--
extra : rebase_source : 7700599ef497a2abadc7970af5ea26b48061966e
2017-11-09 00:43:30 -08:00
David Anderson
32e1584385 Remove easily-removed cases of DataSourceSurface::GetData(). (bug 1405390 part 1, r=bas)
--HG--
extra : rebase_source : cc0d8001240efb530daa9845bc126e5026682340
2017-11-09 00:43:29 -08:00
Mats Palmgren
1c2b8c222e Bug 1414666 part 1 - Add nsIFrame::PresShell() for convenient access to the shell. r=emilio
MozReview-Commit-ID: 8FPTPKWyVtY
2017-11-09 03:00:48 +01:00
Andrew Osmond
1068bf07ec Bug 1415085 - Make CachedSurface::GetSurfaceKey return a reference instead of a copy. r=decoder 2017-11-07 08:10:01 -05:00
Andrew Osmond
a6578c65f6 Bug 1414762 - imgRequestProxy::CancelAndForgetObserver should always force load group removal to dispatch. r=tnikkel
imgRequestProxy::CancelAndForgetObserver was intended to always dispatch
any load group removals due to reentracy conflicts with the callers.
However in bug 1404422 the fact that imgRequest::RemoveProxy can
indirectly trigger a load group removal through completing an
incompleted request.
2017-11-07 06:42:47 -05:00
Ursula Sarracini
df4f8ff8c2 Bug 1373258 - Convert PageThumbsProtocol.js to PageThumbsProtocol.cpp r=adw
MozReview-Commit-ID: tdNee2EPdV

--HG--
extra : rebase_source : 436ef616173f22b6d8386b8e7b3f482f1acabca4
2017-06-05 10:04:06 -04:00
Andrew Osmond
95ee2e55dc Bug 1404422 - Part 4. Remove imgIOnloadBlocker and related from tree as redundant. r=tnikkel 2017-11-01 06:59:10 -04:00
Andrew Osmond
3e3c2a5bca Bug 1404422 - Part 3. Disable triggering imgIOnloadBlocker block/unblock events. r=tnikkel 2017-11-01 06:59:10 -04:00
Andrew Osmond
c57b395b1a Bug 1404422 - Part 1d. Ensure imgRequestProxy::PerformClone consistently adds the clone to the expected load group. r=tnikkel
Historically imgRequestProxy::PerformClone would only add the cloned
request to the (original proxy's) document's load group if the request
was still being validated. Now it adds the cloned request to the given
document's load group before requesting the notifications, unless the
request has already been completed. We ensure that any removals from
the load group occur outside the current execution context.

Legacy listeners may use imgRequestProxy::SyncClone to request
notifications on the image state. Ideally they would not, but they do
not work as expected with the asynchronous notifications all new callers
must use. While in theory this would suggest their code is re-entrant,
not all of it is. In particular we need to be sensitive about when we
remove a request from a load group.
2017-11-01 06:59:10 -04:00
Andrew Osmond
920629550f Bug 1404422 - Part 1c. Refactor how an imgRequestProxy is added/removed from its load group. r=tnikkel
There should be no functional change here, but we rely upon the new
structure in the next patch in the series. This separates out the
notions of removing a request from the load group (which is always
final, and must be executed outside of synchronous calls from the owner
of the imgRequestProxy) and wanting to readd a request to the load group
as a background request (for multipart images).

The most important addition is mForceDispatchLoadGroup which if true
when imgRequestProxy::RemoveFromLoadGroup is called, will dispatch the
removal from the load group instead of executing it inline. This ensures
safety for any callers (e.g. to CancelAndForgetObserver) as above.
2017-11-01 06:59:10 -04:00
Andrew Osmond
b8832c3e1b Bug 1404422 - Part 1b. Make imgRequestProxy::SetLoadGroup return an error if changing the load group. r=tnikkel
imgRequestProxy::SetLoadGroup did not have a predictable effect and
it appears to be unused. It is somewhat complicated to support given
we must be sensitive about what context we execute removing the
request from the original load group.
2017-11-01 06:59:09 -04:00
Andrew Osmond
b62d4a8ea4 Bug 1404422 - Part 1a. Ensure imgLoader::LoadImage(WithChannel) adds the request to the expected load group. r=tnikkel
imgLoader::LoadImage now asserts in debug builds that the load group
given as a parameter matches that of the given document (if any). If
they mismatch, then we won't be blocking the document's load event as we
expect with the future removal of the imgIOnloadBlocker.

imgLoader::LoadImageWithChannel never actually added the request to the
load group at all, unless it was done as part of the validator. Now it
will consistently add the request to the channel's load group as
expected. Additionally it also asserts in debug builds that the
channel's load group matches that of the given document, as in
LoadImage.
2017-11-01 06:59:09 -04:00
Andrea Marchesini
243e3d19f0 Bug 1411506 - SourceBuffer::AppendFromInputStream must check if the stream has been already closed, r=aosmond 2017-10-25 16:58:45 +02:00
Sebastian Hengst
18f1987735 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-10-23 11:46:34 +02:00