Commit Graph

289 Commits

Author SHA1 Message Date
Ryan Hunt
0d74eb35a6 Remove BeginPaintBuffer (bug 1409871 part 18, r=nical)
Now that BeginPaintBuffer and BeginPaint are both implemented by content client,
I think it makes sense to just merge them into one method. This simplifies the
interface clients have to use.

MozReview-Commit-ID: 8bjH6WcpZS9
2017-10-18 15:20:14 -04:00
Ryan Hunt
f6ac493ed4 Clean up some methods on ContentClient (bug 1409871 part 17, r=nical)
This commit does some more cleanup on the content client class hierarchy.
Some methods were virtual or instance methods when they didn't need to be.

MozReview-Commit-ID: 2y2D3zYtYvM
2017-10-18 14:54:26 -04:00
Ryan Hunt
506f8e4a2e Fix PrepareDrawTargetForPainting (bug 1409871 part 16, r=dvander)
CapturedPaintState::mTarget is actually a dual draw target to the black and
white draw targets, so this code will have the white draw target cleared black
and then white. This isn't incorrect, it's just wasteful.

MozReview-Commit-ID: ItgiSmegPK6
2017-10-18 14:46:54 -04:00
Ryan Hunt
4adbf800ba Use a rect instead of a region for UpdateDestinationFrom (bug 1409871 part 15, r=nical)
UpdateDestinationFrom actually only uses a rect, so it's best to not be
misleading and force the clients of it to do the conversion.

MozReview-Commit-ID: EsUv3apqnku
2017-10-18 14:35:18 -04:00
Ryan Hunt
c381686c72 Update comments for ContentClient (bug 1409871 part 13, r=nical)
This could be a part of the previous commit, but I omitted it to keep the size
down. Just some updates to comments and documentation.

MozReview-Commit-ID: HkCOSIQhBNv
2017-10-18 13:42:19 -04:00
Ryan Hunt
78f2e18a94 Kill RotatedContentBuffer (bug 1409871 part 12, r=nical)
This commit is the guts of the refactoring.

This commit removes rotated content buffer, and moves the necessary
functionality to content client. All content clients now do not inherit from
rotated content buffer, but contain a refptr to a rotated buffer.

For the basic content client, this is a DrawTargetRotatedBuffer.
For the remote content client, this is a RemoteRotatedBuffer.
The double buffered content client contains an additional RemoteRotatedBuffer
for the front buffer.

Each derived class of content client only needs to implement a method to
create its own rotated buffer. The rest is handled by the base content
client. The remote content clients still override some additional methods
to sync buffers and do IPC.

MozReview-Commit-ID: B9vcSi8UYhm
2017-10-16 19:45:11 -04:00
Ryan Hunt
1d8186c2bd Remove PaintState::mDidSelfCopy. (bug 1409871 part 9, r=nical)
Miscellaneous cleanup, PaintState doesn't need to know this as no one uses
this information outside of the content client classes.

MozReview-Commit-ID: 6K8LxEPvp4V
2017-10-12 17:24:50 -04:00
Ryan Hunt
7f1f7469a9 Move mFrontAndBackBufferDiffer to ContentClientDoubleBuffered. (bug 1409871 part 8, r=nical)
Miscellaneous cleanup, ContentClientSingleBuffered doesn't need to track if
the front and back buffer differ.

MozReview-Commit-ID: IvAw0b92jsh
2017-10-12 12:58:17 -04:00
Ryan Hunt
284c1e869d Use a RemoteRotatedBuffer for the front buffer of ContentClientDoubleBuffered. (bug 1409871 part 5, r=nical)
The front buffer for a double buffered content client is really just another
rotated buffer, so it can simplify the code to use the class we just added.
The goal is to have the back and the front buffer using remote rotated buffers,
but this is a good first step.

Note: The front buffer is represented as a Maybe<RemoteRotatedBuffer> in this
commit, but in the future it will be a RefPtr. That can't be done yet, because
rotated buffer can't implement refcounting in addition to compositable client.

MozReview-Commit-ID: Czk3otkf1pb
2017-10-11 15:22:57 -04:00
Ryan Hunt
6129ac13bb Move DrawTo to RotatedBuffer. (bug 1409871 part 3, r=nical)
Similar to the previous patch, more functionality can be moved to rotated
buffer and out of rotated content client.

MozReview-Commit-ID: FNqfonyBBq9
2017-10-11 15:31:20 -04:00
Ryan Hunt
30634cbbaa Move UpdateDestinationFrom to RotatedBuffer. (bug 1409871 part 2, r=nical)
UpdateDestinationFrom is a useful method for any rotated buffer. This will be
needed when content clients are no longer rotated buffers.

Note: EnsureBuffer and EnsureBufferOnWhite were moved out of
UpdateDestinationFrom because I'd like to kill those methods, and so the calls
were moved to all users of UpdateDestinationFrom.

MozReview-Commit-ID: 2e3HhUsZ6iw
2017-10-11 13:40:16 -04:00
Ryan Hunt
453f7753fd Remove ContentClientRemote. (bug 1409871 part 1, r=nical)
This class doesn't seem to be necessary and only complicates the class
hierarchy.

MozReview-Commit-ID: 6dRXce1vB9T
2017-10-11 12:43:39 -04:00
Sebastian Hengst
94853f4e18 Backed out changeset 45596e6d2e2f (bug 1409871) on request from rhunt for causing black context menus on Windows. r=backout 2017-10-23 23:44:15 +02:00
Sebastian Hengst
fb6a690cd5 Backed out changeset 0c763c30594d (bug 1409871) 2017-10-23 23:44:09 +02:00
Sebastian Hengst
66ebccfbb4 Backed out changeset a9f8832adcb4 (bug 1409871) 2017-10-23 23:44:04 +02:00
Sebastian Hengst
3636244275 Backed out changeset 92d59687d486 (bug 1409871) 2017-10-23 23:43:52 +02:00
Sebastian Hengst
4cf15d869e Backed out changeset d57058c8c12e (bug 1409871) 2017-10-23 23:43:36 +02:00
Sebastian Hengst
db74b2b58f Backed out changeset cce97a15c945 (bug 1409871) 2017-10-23 23:43:30 +02:00
Sebastian Hengst
0a8fb1e0f8 Backed out changeset 7b7bcdf87539 (bug 1409871) 2017-10-23 23:43:13 +02:00
Sebastian Hengst
a9b4fa54d4 Backed out changeset 2d9d7435eb63 (bug 1409871) 2017-10-23 23:43:07 +02:00
Sebastian Hengst
f047f5fa6e Backed out changeset 482309a25d13 (bug 1409871) 2017-10-23 23:42:56 +02:00
Sebastian Hengst
05fcd344ca Backed out changeset 7e2fc94f5be9 (bug 1409871) 2017-10-23 23:42:51 +02:00
Sebastian Hengst
f4cf06d700 Backed out changeset 466f20f34a13 (bug 1409871) 2017-10-23 23:42:45 +02:00
Sebastian Hengst
196b098371 Backed out changeset 352a6f520d27 (bug 1409871) 2017-10-23 23:42:39 +02:00
Sebastian Hengst
37096c3eab Backed out changeset 56fe4c3c3b04 (bug 1409871) 2017-10-23 23:42:34 +02:00
Sebastian Hengst
bb46083256 Backed out changeset a4e35be8cf4c (bug 1409871) 2017-10-23 23:42:28 +02:00
Ryan Hunt
ff2e451f32 Be sure to unlock the old back buffer before we release it. (bug 1409871 part 20, r=nical)
MozReview-Commit-ID: HR9EiYrDeqT
2017-10-20 12:28:41 -04:00
Ryan Hunt
b347cc81a4 Remove mInAsyncPaint and move locking new back buffer into BeginPaint (bug 1409871 part 19, r=nical)
mInAsyncPaint is only needed because the code using CreateBuffer expects the
buffer to be locked when it is returned. This isn't necessary because we can
now lock in BeginPaint.

MozReview-Commit-ID: 8WazvBKMbvb
2017-10-18 15:31:15 -04:00
Ryan Hunt
7d5f9141d9 Remove BeginPaintBuffer (bug 1409871 part 18, r=nical)
Now that BeginPaintBuffer and BeginPaint are both implemented by content client,
I think it makes sense to just merge them into one method. This simplifies the
interface clients have to use.

MozReview-Commit-ID: 8bjH6WcpZS9
2017-10-18 15:20:14 -04:00
Ryan Hunt
ad0bb37ab6 Clean up some methods on ContentClient (bug 1409871 part 17, r=nical)
This commit does some more cleanup on the content client class hierarchy.
Some methods were virtual or instance methods when they didn't need to be.

MozReview-Commit-ID: 2y2D3zYtYvM
2017-10-18 14:54:26 -04:00
Ryan Hunt
07962ccf99 Fix PrepareDrawTargetForPainting (bug 1409871 part 16, r=dvander)
CapturedPaintState::mTarget is actually a dual draw target to the black and
white draw targets, so this code will have the white draw target cleared black
and then white. This isn't incorrect, it's just wasteful.

MozReview-Commit-ID: ItgiSmegPK6
2017-10-18 14:46:54 -04:00
Ryan Hunt
5a2fc8bc61 Use a rect instead of a region for UpdateDestinationFrom (bug 1409871 part 15, r=nical)
UpdateDestinationFrom actually only uses a rect, so it's best to not be
misleading and force the clients of it to do the conversion.

MozReview-Commit-ID: EsUv3apqnku
2017-10-18 14:35:18 -04:00
Ryan Hunt
4898a9b3ee Update comments for ContentClient (bug 1409871 part 13, r=nical)
This could be a part of the previous commit, but I omitted it to keep the size
down. Just some updates to comments and documentation.

MozReview-Commit-ID: HkCOSIQhBNv
2017-10-18 13:42:19 -04:00
Ryan Hunt
d9c72a4bbc Kill RotatedContentBuffer (bug 1409871 part 12, r=nical)
This commit is the guts of the refactoring.

This commit removes rotated content buffer, and moves the necessary
functionality to content client. All content clients now do not inherit from
rotated content buffer, but contain a refptr to a rotated buffer.

For the basic content client, this is a DrawTargetRotatedBuffer.
For the remote content client, this is a RemoteRotatedBuffer.
The double buffered content client contains an additional RemoteRotatedBuffer
for the front buffer.

Each derived class of content client only needs to implement a method to
create its own rotated buffer. The rest is handled by the base content
client. The remote content clients still override some additional methods
to sync buffers and do IPC.

MozReview-Commit-ID: B9vcSi8UYhm
2017-10-16 19:45:11 -04:00
Ryan Hunt
8f4fb20f73 Remove PaintState::mDidSelfCopy. (bug 1409871 part 9, r=nical)
Miscellaneous cleanup, PaintState doesn't need to know this as no one uses
this information outside of the content client classes.

MozReview-Commit-ID: 6K8LxEPvp4V
2017-10-12 17:24:50 -04:00
Ryan Hunt
f8e9d02ff3 Move mFrontAndBackBufferDiffer to ContentClientDoubleBuffered. (bug 1409871 part 8, r=nical)
Miscellaneous cleanup, ContentClientSingleBuffered doesn't need to track if
the front and back buffer differ.

MozReview-Commit-ID: IvAw0b92jsh
2017-10-12 12:58:17 -04:00
Ryan Hunt
5303563e05 Use a RemoteRotatedBuffer for the front buffer of ContentClientDoubleBuffered. (bug 1409871 part 5, r=nical)
The front buffer for a double buffered content client is really just another
rotated buffer, so it can simplify the code to use the class we just added.
The goal is to have the back and the front buffer using remote rotated buffers,
but this is a good first step.

Note: The front buffer is represented as a Maybe<RemoteRotatedBuffer> in this
commit, but in the future it will be a RefPtr. That can't be done yet, because
rotated buffer can't implement refcounting in addition to compositable client.

MozReview-Commit-ID: Czk3otkf1pb
2017-10-11 15:22:57 -04:00
Ryan Hunt
355aaf1fa1 Move DrawTo to RotatedBuffer. (bug 1409871 part 3, r=nical)
Similar to the previous patch, more functionality can be moved to rotated
buffer and out of rotated content client.

MozReview-Commit-ID: FNqfonyBBq9
2017-10-11 15:31:20 -04:00
Ryan Hunt
4e32d6a1b5 Move UpdateDestinationFrom to RotatedBuffer. (bug 1409871 part 2, r=nical)
UpdateDestinationFrom is a useful method for any rotated buffer. This will be
needed when content clients are no longer rotated buffers.

Note: EnsureBuffer and EnsureBufferOnWhite were moved out of
UpdateDestinationFrom because I'd like to kill those methods, and so the calls
were moved to all users of UpdateDestinationFrom.

MozReview-Commit-ID: 2e3HhUsZ6iw
2017-10-11 13:40:16 -04:00
Ryan Hunt
8348724cb0 Remove ContentClientRemote. (bug 1409871 part 1, r=nical)
This class doesn't seem to be necessary and only complicates the class
hierarchy.

MozReview-Commit-ID: 6dRXce1vB9T
2017-10-11 12:43:39 -04:00
Nicholas Nethercote
9a7b0ad887 Bug 1406296 (part 1) - Remove the profiler's "displaylistdump" feature. r=mstange.
It's not useful.
2017-10-06 17:33:30 +11:00
Nicholas Nethercote
a35e82f193 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Mason Chang
df6089fba6 Bug 1399692 - Backed out changeset 46f0b004bdd2 for not cleaning up content client on the right thread. r=bas
MozReview-Commit-ID: 2eocRWGxjzA
2017-09-20 08:38:30 -07:00
Mason Chang
2151daf353 Bug 1399692 - Copy the front buffer to the back buffer on the paint thread with OMTP enabled. r=bas 2017-09-14 15:09:53 -04:00
Milan Sreckovic
fe9daf64d1 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
2017-08-14 08:29:28 -04:00
David Anderson
23d88a6fec Bug 1385101 Part 2 Hold TextureClients alive during async painting. r=mattwoodrow,mchang 2017-08-05 11:54:11 -07:00
David Anderson
efc531e81d Bug 1385101 Part 1 - Create CapturedPaintState in ContentClient rather than ClientPaintedLayer. r=mchang 2017-08-05 11:25:45 -07:00
David Anderson
41bfb10f56 Don't assert about borrowed DT refcounts when async painting. (bug 1381393, r=mattwoodrow) 2017-07-25 22:38:33 -07:00
Nicholas Nethercote
a7e5660c91 Bug 1360471 (part 4) - Use a bitfield to represent profiler features. r=mstange.
Currently the profiler mostly uses an array of strings to represent which
features are available and in use. This patch changes the profiler core to use
a uint32_t bitfield, which is a much simpler and faster representation.
(nsProfiler and the profiler add-on still use the array of strings, alas.) The
new ProfilerFeature type defines the values in the bitfield.

One side-effect of this change is that profiler_feature_active() now can be
used to query all features. Previously it was just a subset.

Another side-effect is that profiler_get_available_features() no longer incorrectly
indicates support for Java and stack-walking when they aren't supported. (The
handling of task tracer support is unchanged, because the old code handled it
correctly.)
2017-05-01 14:23:34 +10:00
Matt Woodrow
b452f4a2e8 Bug 1341496 - Part 2: Don't use a separate ReadLock for the second component alpha texture as they should always be locked/unlocked at the same time. r=nical 2017-04-19 15:16:13 +12:00