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

196 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 186b24b666 Bug 1370412 - Part 8a. Add "substitutable" flag to ISurfaceProvider state to indicate when the caller won't accept substitutes. r=tnikkel
When SurfaceCache::Lookup is called to access surface data, it indicates
that the caller will not accept substitutes as in the case of
SurfaceCache::LookupBestMatch. As such, we need to be careful not to
remove those surfaces from our cache when pruning (in part 8b). This is
the marker used to track that, at some point, there was a caller which
got this surface that would accept no other (e.g. factor of 2 mode must
make an accept for this particular surface).
2017-09-05 07:58:45 -04:00
Andrew Osmond caf9b84aa6 Bug 1370412 - Part 2. Give image::LookupResult an optional preferred size to decode at when the surface is not found. r=tnikkel 2017-09-05 07:58:45 -04:00
Andrew Osmond 480d81cc52 Bug 1370412 - Part 0. Add imgIContainer::GetNativeSizesLength to determine a ceiling on the maximum number of expected, unique surfaces. r=tnikkel 2017-09-05 07:58:44 -04:00
Andrew Osmond 5fd7930ced Bug 1382664 - RasterImage::OnSurfaceDiscarded should dispatch with ProgressTracker::GetEventTarget. r=tnikkel 2017-08-14 20:26:40 -04:00
Johann Hofmann 4ac05f9ead Bug 1386439 - Record image-drawing in RasterImage::GetImageContainer and RasterImage::GetFrameAtSize for browser_image_startup.js. r=tnikkel
MozReview-Commit-ID: 1JDWyx8toTB

--HG--
extra : rebase_source : 32659556571acb887f85b922731489f91fcd9075
2017-08-02 00:08:02 +02:00
Nicholas Nethercote 49eb219ff5 Bug 1383982 (attempt 2) - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
--HG--
extra : rebase_source : 7075f9570a4262158351ce9ac3ca8360ea4d5394
2017-07-28 20:10:04 +10:00
Sebastian Hengst 9077ac8886 Backed out changeset a57d8f30d1bf (bug 1383982) for build bustage at nsGlobalWindow.cpp:13826: 'class nsWindowSizes' has no member named 'mMallocSizeOf'. r=backout 2017-07-28 09:50:48 +02:00
Nicholas Nethercote 5c3abe8aab Bug 1383982 - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
All the SizeOf{In,Ex}cludingThis() functions take a MallocSizeOf function
which measures memory blocks. This patch introduces a new type, SizeOfState,
which includes a MallocSizeOf function *and* a table of already-measured
pointers, called SeenPtrs. This gives us a general mechanism to measure
graph-like data structures, by recording which nodes have already been
measured. (This approach is used in a number of existing reporters, but not in
a uniform fashion.)

The patch also converts the window memory reporting to use SizeOfState in a lot
of places, all the way through to the measurement of Elements. This is a
precursor for bug 1383977 which will measure Stylo elements, which involve
Arcs.

The patch also converts the existing mAlreadyMeasuredOrphanTrees table in the
OrphanReporter to use the new mechanism.

--HG--
extra : rebase_source : 2c23285f8b6c3b667560a9d14014efc4633aed51
2017-07-28 15:03:44 +10:00
Marco Bonardo 4346bdf652 Bug 1377920 - Too many WARNING: 'obs' from imagelib in debug builds. r=aosmond
MozReview-Commit-ID: 5Rt7VUYpOmt

--HG--
extra : rebase_source : 30add1827cba8508263d0a3c351e104bc5732fa7
2017-07-04 14:49:04 +02:00
Carsten "Tomcat" Book daa67cc9e3 merge mozilla-inbound to mozilla-central a=merge 2017-06-30 12:59:45 +02:00
Timothy Nikkel c7a12ae0d8 Bug 1377252. Stop using RasterImage::IsUnlocked because it doesn't do what we want. r=aosmond
We currently use RasterImage::IsUnlocked for two different purposes:
1) to determine that we can't throw away the decoded image in WillDrawOpaqueNow
2) to determine when to send the unlockeddraw notification

For 1) what we want to check is mLockCount == 0.

For 2) what we actually want to check is mAnimationConsumers == 0. This is because images that are in the visible list in background tabs will have mLockCount == 0 but mAnimationConsumers > 0 and if we are drawing an image we need to make sure it will be animated (mAnimationConsumers == 0 stops the animation). This is what VectorImage already does.
2017-06-29 20:09:44 -05:00
Johann Hofmann 4c2650ccdf Bug 1363059 - Add a test for images loaded at startup vs. images shown at startup. r=florian,jwatt
This patch enables startupRecorder.js to collect data on
loaded and shown raster and SVG images on startup via events
from native code. It also adds a test that uses this data
to find images that are unnecessarily loaded.

I've not fixed any of the affected images yet, there's a
fairly comprehensive whitelist that I want to gradually
decrease by opening bugs in the respective components.

MozReview-Commit-ID: 9KqQvKLtZhu

--HG--
extra : rebase_source : 5f75fcd1152f569a5b48e21d4e4821a24f768ecd
2017-06-15 00:11:48 +02:00
Carsten "Tomcat" Book d5e2b3c9e6 Backed out changeset 2cb9f9ba6b91 (bug 1363059) on a CLOSED TREE for failures in browser_startup_images.js | Loaded image chrome://browser/skin/bookmark-hollow.svg was shown 2017-06-28 16:53:49 +02:00
Johann Hofmann 857d540365 Bug 1363059 - Add a test for images loaded at startup vs. images shown at startup. r=florian,jwatt
This patch enables startupRecorder.js to collect data on
loaded and shown raster and SVG images on startup via events
from native code. It also adds a test that uses this data
to find images that are unnecessarily loaded.

I've not fixed any of the affected images yet, there's a
fairly comprehensive whitelist that I want to gradually
decrease by opening bugs in the respective components.

MozReview-Commit-ID: 9KqQvKLtZhu

--HG--
extra : rebase_source : 856f06320c78ed88c4578fce985b2a526566e825
2017-06-15 00:11:48 +02:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Nicholas Nethercote 58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Timothy Nikkel 9ddfa24f9c Bug 1368440. Drop the layerized version of animated images when they are discarded so we don't show an out of date version of the image. r=aosmond 2017-06-06 00:41:40 -05:00
Timothy Nikkel 5dbb032f4f Bug 1363092. Don't update the state of an animated image that requires an invalidation when creating a new decoder because we may not be able to send invalidations. r=aosmond 2017-06-01 02:19:55 -05:00
Timothy Nikkel c570406a5e Bug 1360572. Invalidate the whole animated image when the composited frame becomes valid. r=aosmond
We invalidate if FrameAnimator::UpdateState marks the composited frame as valid, but we fail to do so if FrameAnimator::RequestRefresh does so.

The other place that sets the composited frame as valid is RasterImage::Decode. This call is actually redundant because the UpdateState call will do the same.

Even though we will invalidate when the decode produces results we could still draw incorrectly if something else invalidates. In which case we would only draw the part of the image that was invalidated. But that should actually be impossible as explained in the comment.
2017-05-03 21:20:35 -05:00
Iris Hsiao ab85c1ac98 Backed out changeset dda520b4ed32 (bug 1360572) for Assertion failure at RasterImage.cpp 2017-05-04 11:30:45 +08:00
Timothy Nikkel 82de893b0a Bug 1360572. Invalidate the whole animated image when the composited frame becomes valid. r=aosmond
We invalidate if FrameAnimator::UpdateState marks the composited frame as valid, but we fail to do so if FrameAnimator::RequestRefresh does so.

The other place that sets the composited frame as valid is RasterImage::Decode. This call is actually redundant because the UpdateState call will do the same.

Even though we will invalidate when the decode produces results we could still draw incorrectly if something else invalidates. In which case we would only draw the part of the image that was invalidated. But that should actually be impossible as explained in the comment.
2017-05-03 21:20:35 -05:00
Timothy Nikkel 91e6c26580 Bug 1353299. Make sure to invalidate when composited frame becomes valid. r=aosmond
We draw nothing when the composited frame is invalid, so when we mark it valid we should invalidate. Usually the action that causes the composited frame to be valid will invalidate (ie RequestRefresh).
2017-04-06 04:00:36 -05:00
Timothy Nikkel fbb79c8298 Bug 1353298. Don't report that an animated image with an invalid composited frame will draw opaquely. r=aosmond
We draw nothing until the composited frame is valid.

The IsFinished call lower down only considers one frame of the animation, so doesn't do what we want.
2017-04-06 04:00:36 -05:00
Timothy Nikkel 7bf131a182 Bug 1351434. Don't do any work in RasterImage::OnSurfaceDiscarded because we hold the surface cache mutex in it. r=aosmond
https://hg.mozilla.org/integration/mozilla-inbound/rev/432215553953 (bug 1343341) is what caused this.

The UpdateState call does a surface cache lookup.
2017-03-28 15:46:23 -05:00
Timothy Nikkel e4990d2f23 Bug 1343341. When the animated images discarding pref is enabled Remove the lifetime lock on animated images and adjust code in RasterImage to allow animated images to be discarded. r=aosmond
Mostly asserts and simple book keeping. The complicated things were in FrameAnimator.
2017-03-27 00:17:52 -05:00
Timothy Nikkel 1614a73bad Bug 1343341. Rewrite animation state updating to derive new state purely based on SurfaceCache and RasterImage::mAnimationFinished. r=aosmond
If the SurfaceCache discards our frames on another thread, the runnable that notifies us of that discard could race with a decode complete notification. So we can't rely on any ordering of SetDiscarded and NotifyDecodeComplete. Thus we must derive our state purely from the SurfaceCache (and mAnimationFinished from RasterImage).

We also update the image state in RequestRefresh (the main place where we use the state that is updated).

The other main place we use the state is GetCompositedFrame, but we don't update the state there. It should be fine because the only time this might lag behind reality is if the frames are discarded, and it should be fine to continue drawing the composited frame until the discard notification arrives.

The way that we tell that an animated image has all of its frames complete in the surface cache is less than ideal.
2017-03-26 00:04:53 -05:00
Timothy Nikkel 63ad0ad7f3 Bug 1343341. Only call AnimationState::SetDiscarded on the main thread. r=aosmond
Image::OnSurfaceDiscarded can be called on any thread. But AnimationState is a main thread only object.
2017-03-25 02:16:21 -05:00
Timothy Nikkel 2776a4ad96 Bug 1343341. In FrameAnimator look up our frames once and pass them around. r=aosmond
The SurfaceCache can discard on any thread at any time. So we could be in the middle of advancing frames of a fully decoded animated image and then the frames could disappear out from under us.

Making the code deal with that kind of a situation would make the logic very complicated. So instead just look up the frames once and pass them around, that way they never change during while we are advancing the frame.
2017-03-24 00:57:30 -05:00
Carsten "Tomcat" Book 332688962a Merge mozilla-central to mozilla-inbound
--HG--
rename : testing/web-platform/tests/storage/interfaces.html => testing/web-platform/tests/storage/interfaces.https.html
2017-03-23 13:57:16 +01:00
Carsten "Tomcat" Book 492970c342 merge mozilla-inbound to mozilla-central a=merge 2017-03-23 13:44:09 +01:00
Andrew Osmond 449b1552c1 Bug 1343499 - Expose native image sizes to imagelib users. r=tnikkel 2017-03-22 09:05:36 -04:00
Timothy Nikkel f088324ed2 Bug 1347302. Add animated image specific probes for several imagelib telemetry probes. r=aosmond f=bsmedberg 2017-03-23 00:02:54 -05:00
Markus Stange 730b4fc829 Bug 1339897 - Rename PROFILER_LABEL_PRINTF to PROFILER_LABEL_DYNAMIC and make it really cheap. r=Ehsan,njn
Instead of copying and concatenating strings into an mDest buffer in
SamplerStackFramePrintfRAII, require callers to keep the string buffer alive
for the duration of the current scope, and store the pointer to the annotation
string in the ProfileEntry. During stackwalking, concatenate the label and the
annotation (separated by a space) and store the resulting string in the
profile buffer.

MozReview-Commit-ID: GEjcLrhhdvb

--HG--
extra : rebase_source : 683749421ee2122805a249cf413e882ee5f33331
2017-03-22 19:37:33 -04:00
Andrew Osmond c21c5cb4c8 Backed out changeset 619b5b27ce87 (bug 1343499) for CLOSED TREE build bustage r=backout 2017-03-22 11:04:30 -04:00
Andrew Osmond a60b290b56 Bug 1343499 - Expose native image sizes to imagelib users. r=tnikkel 2017-03-22 09:05:36 -04:00
Andrew Osmond 9f71f348c1 Backed out changeset 0b797601dc36 (bug 1343499) for build bustages. r=backout 2017-03-22 09:19:05 -04:00
Andrew Osmond cbf46adaef Bug 1343499 - Expose native image sizes to imagelib users. r=tnikkel 2017-03-22 09:05:36 -04:00
Timothy Nikkel e9cd32eecd Bug 1343341. Fix a bug with redecoding images whose animation is finished. r=aosmond
For animated images with finite animations we can finish running their animation. At which point we won't call RequestRefresh, and so we will never mark the composited frame as valid (since that is the only place we do that).

To fix this we mark the composited frame as valid when we finish decoding.

But we can do better than that, we can mark the composited frame as valid immediately when we create a new decoded since we are just drawing the final frame from now on.
2017-03-17 00:41:44 -05:00
Timothy Nikkel 23f3425afe Bug 1343341. Only set the animation state as discarded if we discarded the animated frames (and not a static frame from a first-frame-only decode). r=aosmond
The SurfaceCache can hold the first frame of a "static" decode as well as the animated frames in two seperate entries. We only care about what happens to the animated frames, so ignore OnSurfaceDiscarded for anything else.

To accomplish this we must pass the SurfaceKey to OnSurfaceDiscarded.
2017-03-16 03:06:06 -05:00
Timothy Nikkel d69ec52e66 Bug 1343341. Create state on the AnimationState object to track whether the image is decoded or not. r=aosmond
We end up needing to track a few different things.

The large comment in the patch explains.
2017-03-16 03:06:04 -05:00
Timothy Nikkel bb32ac7fbf Backed out changeset a23edcf5b82a (bug 1343341) 2017-03-15 03:13:51 -05:00
Timothy Nikkel 0f1d7652b6 Backed out changeset 29e2e6dd82d2 (bug 1343341) 2017-03-15 03:13:33 -05:00
Timothy Nikkel d1b5ed8ea1 Bug 1343341. Only set the animation state as discarded if we discarded the animated frames (and not a static frame from a first-frame-only decode). r=aosmond
The SurfaceCache can hold the first frame of a "static" decode as well as the animated frames in two seperate entries. We only care about what happens to the animated frames, so ignore OnSurfaceDiscarded for anything else.

To accomplish this we must pass the SurfaceKey to OnSurfaceDiscarded.
2017-03-15 02:47:40 -05:00
Timothy Nikkel a2ceaae0b8 Bug 1343341. Create state on the AnimationState object to track whether the image is decoded or not. r=aosmond
We end up needing to track a few different things.

The large comment in the patch explains.
2017-03-15 02:47:37 -05:00
Timothy Nikkel d58225c24c Backed out changeset 7f13c7a84acb (bug 1343341) for hitting a fatal assert that it added in RasterImage::OnSurfaceDiscard sometimes on android reftests. 2017-03-02 02:24:29 -06:00
Timothy Nikkel 558fc1aa45 Bug 1343341. Create state on the AnimationState object to track whether the image is decoded or not. r=aosmond
We end up needing to track a few different things.

The large comment in the patch explains.
2017-03-01 22:45:54 -06:00