mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-01 12:03:08 +00:00
Merge m-c to fx-team. a=merge
This commit is contained in:
commit
dde1078a03
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
@ -129,7 +129,7 @@
|
||||
<!-- dolphin specific things -->
|
||||
<project name="device/sprd" path="device/sprd" revision="0351ccd65808a2486e0fefb99674ca7a64c2c6dc"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="4e58336019b5cbcfd134caf55b142236cf986618"/>
|
||||
<project name="platform/frameworks/av" path="frameworks/av" revision="facca8d3e35431b66f85a4eb42bc6c5b24bd04da"/>
|
||||
<project name="platform/frameworks/av" path="frameworks/av" revision="4387fe988e5a1001f29ce05fcfda03ed2d32137b"/>
|
||||
<project name="platform/hardware/akm" path="hardware/akm" revision="6d3be412647b0eab0adff8a2768736cf4eb68039"/>
|
||||
<project groups="invensense" name="platform/hardware/invensense" path="hardware/invensense" revision="e6d9ab28b4f4e7684f6c07874ee819c9ea0002a2"/>
|
||||
<project name="platform/hardware/ril" path="hardware/ril" revision="865ce3b4a2ba0b3a31421ca671f4d6c5595f8690"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="20a1521efdac44c8219f00c2414de031891fb464"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="20a1521efdac44c8219f00c2414de031891fb464"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "95521d1e0cf64f0d95be0cf643931e20119a7387",
|
||||
"revision": "1cd63caaf46eefcdaa427914e363220096a1c09a",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="20a1521efdac44c8219f00c2414de031891fb464"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4e9aa22d15b77e5b3d7e763128ead2caffd3b801"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e30d373eb5ed0514bce08a3b3d80d71b05a4dc32"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -3942,7 +3942,9 @@ void HTMLMediaElement::UpdateAudioChannelPlayingState()
|
||||
(!mPaused &&
|
||||
(HasAttr(kNameSpaceID_None, nsGkAtoms::loop) ||
|
||||
(mReadyState >= nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA &&
|
||||
!IsPlaybackEnded()) ||
|
||||
!IsPlaybackEnded() &&
|
||||
!(mSrcStream && !(mSrcStream->GetTrackTypesAvailable() &
|
||||
DOMMediaStream::HINT_CONTENTS_AUDIO))) ||
|
||||
mPlayingThroughTheAudioChannelBeforeSeek));
|
||||
if (playingThroughTheAudioChannel != mPlayingThroughTheAudioChannel) {
|
||||
mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;
|
||||
|
@ -171,6 +171,8 @@ public:
|
||||
TrackTypeHints GetHintContents() const { return mHintContents; }
|
||||
void SetHintContents(TrackTypeHints aHintContents) { mHintContents = aHintContents; }
|
||||
|
||||
TrackTypeHints GetTrackTypesAvailable() const { return mTrackTypesAvailable; }
|
||||
|
||||
/**
|
||||
* Create an nsDOMMediaStream whose underlying stream is a SourceMediaStream.
|
||||
*/
|
||||
|
@ -3739,7 +3739,7 @@ this.DOMApplicationRegistry = {
|
||||
this.broadcastMessage("Webapps:UpdateState", {
|
||||
app: aOldApp,
|
||||
error: aError,
|
||||
id: aNewApp.id
|
||||
id: aId
|
||||
});
|
||||
this.broadcastMessage("Webapps:FireEvent", {
|
||||
eventType: "downloaderror",
|
||||
|
@ -20,6 +20,14 @@ var gDevUrl = "http://dev.url";
|
||||
function handleRequest(request, response) {
|
||||
var query = getQuery(request);
|
||||
|
||||
if ("nextApp" in query) {
|
||||
setState("nextApp", query.nextApp);
|
||||
response.write("OK");
|
||||
return;
|
||||
}
|
||||
|
||||
var nextApp = getState("nextApp");
|
||||
|
||||
response.setHeader("Access-Control-Allow-Origin", "*", false);
|
||||
|
||||
var version = ("version" in query) ? query.version : "1";
|
||||
@ -29,7 +37,7 @@ function handleRequest(request, response) {
|
||||
if (version != prevVersion) {
|
||||
setState("version", version);
|
||||
}
|
||||
var packageName = app + "_app_" + version + ".zip";
|
||||
var packageName = (nextApp.length ? nextApp : app) + "_app_" + version + ".zip";
|
||||
setState("packageName", packageName);
|
||||
var packagePath = "/" + gBasePath + "signed/" + packageName;
|
||||
setState("packagePath", packagePath);
|
||||
@ -37,13 +45,15 @@ function handleRequest(request, response) {
|
||||
|
||||
var etag = getEtag(request, version);
|
||||
|
||||
if (etagMatches(request, etag)) {
|
||||
if (!nextApp.length && etagMatches(request, etag)) {
|
||||
dump("Etags Match. Sending 304\n");
|
||||
response.setStatusLine(request.httpVersion, "304", "Not modified");
|
||||
return;
|
||||
}
|
||||
response.setHeader("Etag", etag, false);
|
||||
|
||||
setState("nextApp", "");
|
||||
|
||||
// Serve the mini-manifest corresponding to the requested app version.
|
||||
var template = gBasePath + gMiniManifestTemplate;
|
||||
|
||||
|
@ -142,12 +142,53 @@ var steps = [
|
||||
var request = navigator.mozApps.installPackage(miniManifestURL);
|
||||
request.onerror = function(evt) {
|
||||
ok(false, "Application should have been correctly installed (error: " +
|
||||
JSON.stringify(evt));
|
||||
request.error.name);
|
||||
};
|
||||
request.onsuccess = function() {
|
||||
info("Application installed");
|
||||
};
|
||||
},
|
||||
function() {
|
||||
// Set up the server side to send a different package on the next call.
|
||||
info("== TEST == Set state to invalid app");
|
||||
var url = gSJS + "?" + "nextApp=unsigned";
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.addEventListener("load", function() {
|
||||
is(xhr.responseText, "OK", "nextApp=unsigned OK");
|
||||
PackagedTestHelper.next();
|
||||
});
|
||||
xhr.addEventListener("error", event => {
|
||||
ok(false, "XHR error loading " + url + ": " + xhr.status + " - " +
|
||||
xhr.statusText);
|
||||
});
|
||||
xhr.addEventListener("abort", event => {
|
||||
ok(false, "XHR abort loading " + url);
|
||||
});
|
||||
xhr.open('GET', url, true);
|
||||
xhr.send();
|
||||
},
|
||||
function() {
|
||||
info("== TEST == Update app from an invalid source");
|
||||
info("Updating app: " + gApp.manifest.name);
|
||||
gApp.ondownloaderror = function() {
|
||||
is(gApp.downloadError.name, "INVALID_SIGNATURE");
|
||||
PackagedTestHelper.next();
|
||||
};
|
||||
gApp.ondownloadsuccess = function() {
|
||||
info("App downloaded");
|
||||
ok(false, "App should not download success");
|
||||
PackagedTestHelper.finish();
|
||||
};
|
||||
info("App manifest: " + gApp.manifestURL);
|
||||
|
||||
// This update check will return a different mini manifest pointing to
|
||||
// an invalid package.
|
||||
var req = gApp.checkForUpdate();
|
||||
req.onsuccess = function() {
|
||||
gApp.download();
|
||||
}
|
||||
req.onerror = PackagedTestHelper.mozAppsError;
|
||||
},
|
||||
function() {
|
||||
info("== TEST == Uninstall a signed app");
|
||||
// Uninstall App
|
||||
|
@ -1463,7 +1463,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
readonly attribute boolean mayHaveTouchEventListeners;
|
||||
|
||||
/**
|
||||
* Check if any ThebesLayer painting has been done for this element,
|
||||
* Check if any PaintedLayer painting has been done for this element,
|
||||
* clears the painted flags if they have.
|
||||
*/
|
||||
boolean checkAndClearPaintedState(in nsIDOMElement aElement);
|
||||
|
@ -4169,7 +4169,15 @@ DataCall.prototype = {
|
||||
return;
|
||||
}
|
||||
if (this.state == RIL.GECKO_NETWORK_STATE_CONNECTED) {
|
||||
networkInterface.notifyRILNetworkInterface();
|
||||
// This needs to run asynchronously, to behave the same way as the case of
|
||||
// non-shared apn, see bug 1059110.
|
||||
Services.tm.currentThread.dispatch(function(state) {
|
||||
// Do not notify if state changed while this event was being dispatched,
|
||||
// the state probably was notified already or need not to be notified.
|
||||
if (networkInterface.state == state) {
|
||||
networkInterface.notifyRILNetworkInterface();
|
||||
}
|
||||
}.bind(null, RIL.GECKO_NETWORK_STATE_CONNECTED), Ci.nsIEventTarget.DISPATCH_NORMAL);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4281,7 +4289,13 @@ DataCall.prototype = {
|
||||
// Notify the DISCONNECTED event immediately after network interface is
|
||||
// removed from requestedNetworkIfaces, to make the DataCall, shared or
|
||||
// not, to have the same behavior.
|
||||
networkInterface.notifyRILNetworkInterface();
|
||||
Services.tm.currentThread.dispatch(function(state) {
|
||||
// Do not notify if state changed while this event was being dispatched,
|
||||
// the state probably was notified already or need not to be notified.
|
||||
if (networkInterface.state == state) {
|
||||
networkInterface.notifyRILNetworkInterface();
|
||||
}
|
||||
}.bind(null, RIL.GECKO_NETWORK_STATE_DISCONNECTED), Ci.nsIEventTarget.DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
// Only deactivate data call if no more network interface needs this
|
||||
|
@ -1254,11 +1254,12 @@ this.STK_SUPPORTED_TERMINAL_PROFILE = [
|
||||
];
|
||||
|
||||
/**
|
||||
* (U)SIM Services.
|
||||
* ICC Services Table.
|
||||
*
|
||||
* @see 3GPP TS 51.011 10.3.7 (SIM) and 3GPP TS 31.102 4.2.8 (USIM).
|
||||
*/
|
||||
this.GECKO_ICC_SERVICES = {
|
||||
// @see 3GPP TS 51.011 10.3.7 (SIM).
|
||||
sim: {
|
||||
ADN: 2,
|
||||
FDN: 3,
|
||||
@ -1279,6 +1280,7 @@ this.GECKO_ICC_SERVICES = {
|
||||
MWIS: 54,
|
||||
SPDI: 56
|
||||
},
|
||||
// @see 3GPP TS 31.102 4.2.8 (USIM).
|
||||
usim: {
|
||||
FDN: 2,
|
||||
SDN: 4,
|
||||
@ -1297,9 +1299,11 @@ this.GECKO_ICC_SERVICES = {
|
||||
MWIS: 48,
|
||||
SPDI: 51
|
||||
},
|
||||
// @see 3GPP2 C.S0023-D 3.4.18 (RUIM).
|
||||
ruim: {
|
||||
ENHANCED_PHONEBOOK: 6,
|
||||
SPN: 17
|
||||
SPN: 17,
|
||||
SDN: 18
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -5629,26 +5629,38 @@ RilObject.prototype[REQUEST_SETUP_DATA_CALL] = function REQUEST_SETUP_DATA_CALL(
|
||||
this[REQUEST_DATA_CALL_LIST](length, options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_SIM_IO] = function REQUEST_SIM_IO(length, options) {
|
||||
let ICCIOHelper = this.context.ICCIOHelper;
|
||||
if (!length) {
|
||||
ICCIOHelper.processICCIOError(options);
|
||||
if (options.rilRequestError) {
|
||||
if (options.onerror) {
|
||||
options.onerror(RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError] ||
|
||||
GECKO_ERROR_GENERIC_FAILURE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't need to read rilRequestError since we can know error status from
|
||||
// sw1 and sw2.
|
||||
let Buf = this.context.Buf;
|
||||
options.sw1 = Buf.readInt32();
|
||||
options.sw2 = Buf.readInt32();
|
||||
// See 3GPP TS 11.11, clause 9.4.1 for opetation success results.
|
||||
|
||||
// See 3GPP TS 11.11, clause 9.4.1 for operation success results.
|
||||
if (options.sw1 !== ICC_STATUS_NORMAL_ENDING &&
|
||||
options.sw1 !== ICC_STATUS_NORMAL_ENDING_WITH_EXTRA &&
|
||||
options.sw1 !== ICC_STATUS_WITH_SIM_DATA &&
|
||||
options.sw1 !== ICC_STATUS_WITH_RESPONSE_DATA) {
|
||||
ICCIOHelper.processICCIOError(options);
|
||||
if (DEBUG) {
|
||||
this.context.debug("ICC I/O Error EF id = 0x" + options.fileId.toString(16) +
|
||||
", command = 0x" + options.command.toString(16) +
|
||||
", sw1 = 0x" + options.sw1.toString(16) +
|
||||
", sw2 = 0x" + options.sw2.toString(16));
|
||||
}
|
||||
if (options.onerror) {
|
||||
// We can get fail cause from sw1/sw2 (See TS 11.11 clause 9.4.1 and
|
||||
// ISO 7816-4 clause 6). But currently no one needs this information,
|
||||
// so simply reports "GenericFailure" for now.
|
||||
options.onerror(GECKO_ERROR_GENERIC_FAILURE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
ICCIOHelper.processICCIO(options);
|
||||
this.context.ICCIOHelper.processICCIO(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_SEND_USSD] = function REQUEST_SEND_USSD(length, options) {
|
||||
if (DEBUG) {
|
||||
@ -12491,28 +12503,6 @@ ICCIOHelperObject.prototype = {
|
||||
options.callback(options);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Process ICC IO error.
|
||||
*/
|
||||
processICCIOError: function(options) {
|
||||
let requestError = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
if (DEBUG) {
|
||||
// See GSM11.11, TS 51.011 clause 9.4, and ISO 7816-4 for the error
|
||||
// description.
|
||||
let errorMsg = "ICC I/O Error code " + requestError +
|
||||
" EF id = " + options.fileId.toString(16) +
|
||||
" command = " + options.command.toString(16);
|
||||
if (options.sw1 && options.sw2) {
|
||||
errorMsg += "(" + options.sw1.toString(16) +
|
||||
"/" + options.sw2.toString(16) + ")";
|
||||
}
|
||||
this.context.debug(errorMsg);
|
||||
}
|
||||
if (options.onerror) {
|
||||
options.onerror(requestError);
|
||||
}
|
||||
},
|
||||
};
|
||||
ICCIOHelperObject.prototype[ICC_COMMAND_SEEK] = null;
|
||||
ICCIOHelperObject.prototype[ICC_COMMAND_READ_BINARY] = function ICC_COMMAND_READ_BINARY(options) {
|
||||
@ -14820,6 +14810,12 @@ ICCContactHelperObject.prototype = {
|
||||
ICCRecordHelper.readADNLike(ICC_EF_FDN, onsuccess, onerror);
|
||||
break;
|
||||
case "sdn":
|
||||
let ICCUtilsHelper = this.context.ICCUtilsHelper;
|
||||
if (!ICCUtilsHelper.isICCServiceAvailable("SDN")) {
|
||||
onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
||||
break;
|
||||
}
|
||||
|
||||
ICCRecordHelper.readADNLike(ICC_EF_SDN, onsuccess, onerror);
|
||||
break;
|
||||
default:
|
||||
|
@ -27,7 +27,7 @@ add_test(function test_error_message_read_icc_contact () {
|
||||
|
||||
// Error 2, specifying a non-supported contactType.
|
||||
ril.appType = CARD_APPTYPE_USIM;
|
||||
do_test({contactType: "sdn"}, CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
||||
do_test({contactType: "foo"}, CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
||||
|
||||
// Error 3, suppose we update the supported PBR fields in USIM_PBR_FIELDS,
|
||||
// but forget to add implemenetations for it.
|
||||
|
@ -54,31 +54,41 @@ add_test(function test_load_linear_fixed_ef() {
|
||||
});
|
||||
|
||||
/**
|
||||
* Verify ICCIOHelper.processICCIOError.
|
||||
* Verify ICC IO Error.
|
||||
*/
|
||||
add_test(function test_process_icc_io_error() {
|
||||
let worker = newUint8Worker();
|
||||
let context = worker.ContextPool._contexts[0];
|
||||
let ioHelper = context.ICCIOHelper;
|
||||
let buf = context.Buf;
|
||||
|
||||
function do_test(errorCode, expectedErrorMsg) {
|
||||
function do_test(sw1, sw2, expectedErrorMsg) {
|
||||
let called = false;
|
||||
function errorCb(errorMsg) {
|
||||
called = true;
|
||||
do_check_eq(errorMsg, expectedErrorMsg);
|
||||
}
|
||||
|
||||
ioHelper.processICCIOError({rilRequestError: errorCode,
|
||||
fileId: 0xffff,
|
||||
command: 0xff,
|
||||
sw1: 0xff,
|
||||
sw2: 0xff,
|
||||
onerror: errorCb});
|
||||
// Write sw1 and sw2 to buffer.
|
||||
buf.writeInt32(sw1);
|
||||
buf.writeInt32(sw2);
|
||||
|
||||
context.RIL[REQUEST_SIM_IO](0, {rilRequestError: ERROR_SUCCESS,
|
||||
fileId: 0xffff,
|
||||
command: 0xff,
|
||||
onerror: errorCb});
|
||||
|
||||
// onerror callback should be triggered.
|
||||
do_check_true(called);
|
||||
}
|
||||
|
||||
for (let i = 0; i < ERROR_REJECTED_BY_REMOTE + 1; i++) {
|
||||
do_test(i, RIL_ERROR_TO_GECKO_ERROR[i]);
|
||||
let TEST_DATA = [
|
||||
// [sw1, sw2, expectError]
|
||||
[ICC_STATUS_ERROR_COMMAND_NOT_ALLOWED, 0xff, GECKO_ERROR_GENERIC_FAILURE],
|
||||
[ICC_STATUS_ERROR_WRONG_PARAMETERS, 0xff, GECKO_ERROR_GENERIC_FAILURE],
|
||||
];
|
||||
|
||||
for (let i = 0; i < TEST_DATA.length; i++) {
|
||||
do_test.apply(null, TEST_DATA[i]);
|
||||
}
|
||||
|
||||
run_next_test();
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsIDOMDocument.h" // for nsIDOMDocument
|
||||
#include "nsIDOMHTMLDocument.h" // for nsIDOMHTMLDocument
|
||||
#include "nsIDOMWindow.h" // for nsIDOMWindow
|
||||
#include "nsIDOMWindowUtils.h" // for nsIDOMWindowUtils
|
||||
#include "nsIDocShell.h" // for nsIDocShell
|
||||
#include "nsIDocument.h" // for nsIDocument
|
||||
#include "nsIDocumentStateListener.h"
|
||||
@ -33,6 +32,7 @@
|
||||
#include "nsIHTMLDocument.h" // for nsIHTMLDocument, etc
|
||||
#include "nsIInterfaceRequestorUtils.h" // for do_GetInterface
|
||||
#include "nsIPlaintextEditor.h" // for nsIPlaintextEditor, etc
|
||||
#include "nsIPresShell.h" // for nsIPresShell
|
||||
#include "nsIRefreshURI.h" // for nsIRefreshURI
|
||||
#include "nsIRequest.h" // for nsIRequest
|
||||
#include "nsISelection.h" // for nsISelection
|
||||
@ -45,6 +45,7 @@
|
||||
#include "nsLiteralString.h" // for NS_LITERAL_STRING
|
||||
#include "nsPICommandUpdater.h" // for nsPICommandUpdater
|
||||
#include "nsPIDOMWindow.h" // for nsPIDOMWindow
|
||||
#include "nsPresContext.h" // for nsPresContext
|
||||
#include "nsReadableUtils.h" // for AppendUTF16toUTF8
|
||||
#include "nsStringFwd.h" // for nsAFlatString
|
||||
|
||||
@ -396,12 +397,13 @@ nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *aWindow)
|
||||
|
||||
if (!mInteractive) {
|
||||
// Disable animation of images in this document:
|
||||
nsCOMPtr<nsIDOMWindowUtils> utils(do_GetInterface(aWindow));
|
||||
NS_ENSURE_TRUE(utils, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||
nsPresContext* presContext = presShell->GetPresContext();
|
||||
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
|
||||
|
||||
rv = utils->GetImageAnimationMode(&mImageAnimationMode);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
utils->SetImageAnimationMode(imgIContainer::kDontAnimMode);
|
||||
mImageAnimationMode = presContext->ImageAnimationMode();
|
||||
presContext->SetImageAnimationMode(imgIContainer::kDontAnimMode);
|
||||
}
|
||||
|
||||
// create and set editor
|
||||
@ -1303,9 +1305,14 @@ nsEditingSession::RestoreAnimationMode(nsIDOMWindow *aWindow)
|
||||
{
|
||||
if (!mInteractive)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindowUtils> utils(do_GetInterface(aWindow));
|
||||
if (utils)
|
||||
utils->SetImageAnimationMode(mImageAnimationMode);
|
||||
nsCOMPtr<nsIDocShell> docShell = GetDocShellFromWindow(aWindow);
|
||||
NS_ENSURE_TRUE(docShell, );
|
||||
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, );
|
||||
nsPresContext* presContext = presShell->GetPresContext();
|
||||
NS_ENSURE_TRUE(presContext, );
|
||||
|
||||
presContext->SetImageAnimationMode(mImageAnimationMode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1390,12 +1397,13 @@ nsEditingSession::ReattachToWindow(nsIDOMWindow* aWindow)
|
||||
if (!mInteractive)
|
||||
{
|
||||
// Disable animation of images in this document:
|
||||
nsCOMPtr<nsIDOMWindowUtils> utils(do_GetInterface(aWindow));
|
||||
NS_ENSURE_TRUE(utils, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||
nsPresContext* presContext = presShell->GetPresContext();
|
||||
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
|
||||
|
||||
rv = utils->GetImageAnimationMode(&mImageAnimationMode);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
utils->SetImageAnimationMode(imgIContainer::kDontAnimMode);
|
||||
mImageAnimationMode = presContext->ImageAnimationMode();
|
||||
presContext->SetImageAnimationMode(imgIContainer::kDontAnimMode);
|
||||
}
|
||||
|
||||
// The third controller takes an nsIEditor as the context
|
||||
|
@ -1637,7 +1637,7 @@ NS_IMETHODIMP nsWebBrowser::EnsureDocShellTreeOwner()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void DrawThebesLayer(ThebesLayer* aLayer,
|
||||
static void DrawPaintedLayer(PaintedLayer* aLayer,
|
||||
gfxContext* aContext,
|
||||
const nsIntRegion& aRegionToDraw,
|
||||
DrawRegionClip aClip,
|
||||
@ -1682,14 +1682,14 @@ bool nsWebBrowser::PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion)
|
||||
NS_ASSERTION(layerManager, "Must be in paint event");
|
||||
|
||||
layerManager->BeginTransaction();
|
||||
nsRefPtr<ThebesLayer> root = layerManager->CreateThebesLayer();
|
||||
nsRefPtr<PaintedLayer> root = layerManager->CreatePaintedLayer();
|
||||
if (root) {
|
||||
nsIntRect dirtyRect = aRegion.GetBounds();
|
||||
root->SetVisibleRegion(dirtyRect);
|
||||
layerManager->SetRoot(root);
|
||||
}
|
||||
|
||||
layerManager->EndTransaction(DrawThebesLayer, &mBackgroundColor);
|
||||
layerManager->EndTransaction(DrawPaintedLayer, &mBackgroundColor);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -162,16 +162,16 @@ MOZ_BEGIN_ENUM_CLASS(CompositableType, uint8_t)
|
||||
BUFFER_IMAGE_SINGLE, // image/canvas with a single texture, single buffered
|
||||
BUFFER_IMAGE_BUFFERED, // canvas, double buffered
|
||||
BUFFER_BRIDGE, // image bridge protocol
|
||||
BUFFER_CONTENT_INC, // thebes layer interface, only sends incremental
|
||||
BUFFER_CONTENT_INC, // painted layer interface, only sends incremental
|
||||
// updates to a texture on the compositor side.
|
||||
// somewhere in the middle
|
||||
BUFFER_TILED, // tiled thebes layer
|
||||
BUFFER_TILED, // tiled painted layer
|
||||
BUFFER_SIMPLE_TILED,
|
||||
// the new compositable types
|
||||
IMAGE, // image with single buffering
|
||||
IMAGE_OVERLAY, // image without buffer
|
||||
CONTENT_SINGLE, // thebes layer interface, single buffering
|
||||
CONTENT_DOUBLE, // thebes layer interface, double buffering
|
||||
CONTENT_SINGLE, // painted layer interface, single buffering
|
||||
CONTENT_DOUBLE, // painted layer interface, double buffering
|
||||
BUFFER_COUNT
|
||||
MOZ_END_ENUM_CLASS(CompositableType)
|
||||
|
||||
|
@ -44,8 +44,8 @@ void ImageLayer::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSu
|
||||
}
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(local, sourceRect, nullptr) *
|
||||
SnapTransformTranslation(aTransformToSurface, nullptr);
|
||||
|
@ -36,7 +36,7 @@ MOZ_BEGIN_ENUM_CLASS(ImageFormat)
|
||||
* The CAIRO_SURFACE format creates a CairoImage. All backends should
|
||||
* support this format, because video rendering sometimes requires it.
|
||||
*
|
||||
* This format is useful even though a ThebesLayer could be used.
|
||||
* This format is useful even though a PaintedLayer could be used.
|
||||
* It makes it easy to render a cairo surface when another Image format
|
||||
* could be used. It can also avoid copying the surface data in some
|
||||
* cases.
|
||||
|
@ -77,7 +77,7 @@ namespace layers {
|
||||
* layers C1...Cn, where C1 has FrameMetrics FM1 and Cn has FrameMetrics Fn.
|
||||
* Although in this example C (in the first layer tree) and C0 (in the second
|
||||
* layer tree) are both ContainerLayers (because they have children), they
|
||||
* do not have to be. They may just be ThebesLayers or ColorLayers, for example,
|
||||
* do not have to be. They may just be PaintedLayers or ColorLayers, for example,
|
||||
* which do not have any children. However, the type of C will always be the
|
||||
* same as the type of C0.
|
||||
*
|
||||
|
@ -715,7 +715,7 @@ SenderHelper::SendLayer(LayerComposite* aLayer,
|
||||
}
|
||||
case Layer::TYPE_IMAGE:
|
||||
case Layer::TYPE_CANVAS:
|
||||
case Layer::TYPE_THEBES: {
|
||||
case Layer::TYPE_PAINTED: {
|
||||
// Get CompositableHost and Compositor
|
||||
CompositableHost* compHost = aLayer->GetCompositableHost();
|
||||
Compositor* comp = compHost->GetCompositor();
|
||||
|
@ -1151,11 +1151,11 @@ ContainerLayer::HasOpaqueAncestorLayer(Layer* aLayer)
|
||||
void
|
||||
ContainerLayer::DidRemoveChild(Layer* aLayer)
|
||||
{
|
||||
ThebesLayer* tl = aLayer->AsThebesLayer();
|
||||
PaintedLayer* tl = aLayer->AsPaintedLayer();
|
||||
if (tl && tl->UsedForReadback()) {
|
||||
for (Layer* l = mFirstChild; l; l = l->GetNextSibling()) {
|
||||
if (l->GetType() == TYPE_READBACK) {
|
||||
static_cast<ReadbackLayer*>(l)->NotifyThebesLayerRemoved(tl);
|
||||
static_cast<ReadbackLayer*>(l)->NotifyPaintedLayerRemoved(tl);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1343,7 +1343,7 @@ Layer::Dump(std::stringstream& aStream, const char* aPrefix, bool aDumpHtml)
|
||||
if (aDumpHtml) {
|
||||
aStream << nsPrintfCString("<li><a id=\"%p\" ", this).get();
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (GetType() == TYPE_CONTAINER || GetType() == TYPE_THEBES) {
|
||||
if (GetType() == TYPE_CONTAINER || GetType() == TYPE_PAINTED) {
|
||||
WriteSnapshotLinkToDumpFile(this, aStream);
|
||||
}
|
||||
#endif
|
||||
@ -1620,7 +1620,7 @@ Layer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
PaintedLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
{
|
||||
Layer::PrintInfo(aStream, aPrefix);
|
||||
if (!mValidRegion.IsEmpty()) {
|
||||
@ -1629,13 +1629,13 @@ ThebesLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
|
||||
PaintedLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
|
||||
{
|
||||
Layer::DumpPacket(aPacket, aParent);
|
||||
// get this layer data
|
||||
using namespace layerscope;
|
||||
LayersPacket::Layer* layer = aPacket->mutable_layer(aPacket->layer_size()-1);
|
||||
layer->set_type(LayersPacket::Layer::ThebesLayer);
|
||||
layer->set_type(LayersPacket::Layer::PaintedLayer);
|
||||
if (!mValidRegion.IsEmpty()) {
|
||||
DumpRegion(layer->mutable_valid(), mValidRegion);
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class ClientLayerManager;
|
||||
class CommonLayerAttributes;
|
||||
class Layer;
|
||||
class LayerMetricsWrapper;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
class ContainerLayer;
|
||||
class ImageLayer;
|
||||
class ColorLayer;
|
||||
@ -159,8 +159,8 @@ static void LayerManagerUserDataDestroy(void *data)
|
||||
* BeginTransaction and BeginTransactionWithTarget start a transaction in
|
||||
* the Construction phase. When the client has finished constructing the layer
|
||||
* tree, it should call EndConstruction() to enter the drawing phase.
|
||||
* 2) Drawing: ThebesLayers are rendered into in this phase, in tree
|
||||
* order. When the client has finished drawing into the ThebesLayers, it should
|
||||
* 2) Drawing: PaintedLayers are rendered into in this phase, in tree
|
||||
* order. When the client has finished drawing into the PaintedLayers, it should
|
||||
* call EndTransaction to complete the transaction.
|
||||
*
|
||||
* All layer API calls happen on the main thread.
|
||||
@ -235,7 +235,7 @@ public:
|
||||
enum EndTransactionFlags {
|
||||
END_DEFAULT = 0,
|
||||
END_NO_IMMEDIATE_REDRAW = 1 << 0, // Do not perform the drawing phase
|
||||
END_NO_COMPOSITE = 1 << 1, // Do not composite after drawing thebes layer contents.
|
||||
END_NO_COMPOSITE = 1 << 1, // Do not composite after drawing painted layer contents.
|
||||
END_NO_REMOTE_COMPOSITE = 1 << 2 // Do not schedule a composition with a remote Compositor, if one exists.
|
||||
};
|
||||
|
||||
@ -246,7 +246,7 @@ public:
|
||||
/**
|
||||
* Attempts to end an "empty transaction". There must have been no
|
||||
* changes to the layer tree since the BeginTransaction().
|
||||
* It's possible for this to fail; ThebesLayers may need to be updated
|
||||
* It's possible for this to fail; PaintedLayers may need to be updated
|
||||
* due to VRAM data being lost, for example. In such cases this method
|
||||
* returns false, and the caller must proceed with a normal layer tree
|
||||
* update and EndTransaction.
|
||||
@ -254,20 +254,20 @@ public:
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) = 0;
|
||||
|
||||
/**
|
||||
* Function called to draw the contents of each ThebesLayer.
|
||||
* Function called to draw the contents of each PaintedLayer.
|
||||
* aRegionToDraw contains the region that needs to be drawn.
|
||||
* This would normally be a subregion of the visible region.
|
||||
* The callee must draw all of aRegionToDraw. Drawing outside
|
||||
* aRegionToDraw will be clipped out or ignored.
|
||||
* The callee must draw all of aRegionToDraw.
|
||||
* This region is relative to 0,0 in the ThebesLayer.
|
||||
* This region is relative to 0,0 in the PaintedLayer.
|
||||
*
|
||||
* aRegionToInvalidate contains a region whose contents have been
|
||||
* changed by the layer manager and which must therefore be invalidated.
|
||||
* For example, this could be non-empty if a retained layer internally
|
||||
* switches from RGBA to RGB or back ... we might want to repaint it to
|
||||
* consistently use subpixel-AA or not.
|
||||
* This region is relative to 0,0 in the ThebesLayer.
|
||||
* This region is relative to 0,0 in the PaintedLayer.
|
||||
* aRegionToInvalidate may contain areas that are outside
|
||||
* aRegionToDraw; the callee must ensure that these areas are repainted
|
||||
* in the current layer manager transaction or in a later layer
|
||||
@ -277,9 +277,9 @@ public:
|
||||
* We guarantee that buffered contents in the visible
|
||||
* region are valid once drawing is complete.
|
||||
*
|
||||
* The origin of aContext is 0,0 in the ThebesLayer.
|
||||
* The origin of aContext is 0,0 in the PaintedLayer.
|
||||
*/
|
||||
typedef void (* DrawThebesLayerCallback)(ThebesLayer* aLayer,
|
||||
typedef void (* DrawPaintedLayerCallback)(PaintedLayer* aLayer,
|
||||
gfxContext* aContext,
|
||||
const nsIntRegion& aRegionToDraw,
|
||||
DrawRegionClip aClip,
|
||||
@ -289,11 +289,11 @@ public:
|
||||
/**
|
||||
* Finish the construction phase of the transaction, perform the
|
||||
* drawing phase, and end the transaction.
|
||||
* During the drawing phase, all ThebesLayers in the tree are
|
||||
* During the drawing phase, all PaintedLayers in the tree are
|
||||
* drawn in tree order, exactly once each, except for those layers
|
||||
* where it is known that the visible region is empty.
|
||||
*/
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT) = 0;
|
||||
|
||||
@ -373,35 +373,35 @@ public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Hints that can be used during Thebes layer creation to influence the type
|
||||
* Hints that can be used during PaintedLayer creation to influence the type
|
||||
* or properties of the layer created.
|
||||
*
|
||||
* NONE: No hint.
|
||||
* SCROLLABLE: This layer may represent scrollable content.
|
||||
*/
|
||||
enum ThebesLayerCreationHint {
|
||||
enum PaintedLayerCreationHint {
|
||||
NONE, SCROLLABLE
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if aLayer is optimized for the given ThebesLayerCreationHint.
|
||||
* Returns true if aLayer is optimized for the given PaintedLayerCreationHint.
|
||||
*/
|
||||
virtual bool IsOptimizedFor(ThebesLayer* aLayer,
|
||||
ThebesLayerCreationHint aCreationHint)
|
||||
virtual bool IsOptimizedFor(PaintedLayer* aLayer,
|
||||
PaintedLayerCreationHint aCreationHint)
|
||||
{ return true; }
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Create a ThebesLayer for this manager's layer tree.
|
||||
* Create a PaintedLayer for this manager's layer tree.
|
||||
*/
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer() = 0;
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() = 0;
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Create a ThebesLayer for this manager's layer tree, with a creation hint
|
||||
* Create a PaintedLayer for this manager's layer tree, with a creation hint
|
||||
* parameter to help optimise the type of layer created.
|
||||
*/
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayerWithHint(ThebesLayerCreationHint) {
|
||||
return CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayerWithHint(PaintedLayerCreationHint) {
|
||||
return CreatePaintedLayer();
|
||||
}
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
@ -738,7 +738,7 @@ public:
|
||||
TYPE_READBACK,
|
||||
TYPE_REF,
|
||||
TYPE_SHADOW,
|
||||
TYPE_THEBES
|
||||
TYPE_PAINTED
|
||||
};
|
||||
|
||||
/**
|
||||
@ -791,7 +791,7 @@ public:
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* This lets layout make some promises about what will be drawn into the
|
||||
* visible region of the ThebesLayer. This enables internal quality
|
||||
* visible region of the PaintedLayer. This enables internal quality
|
||||
* and performance optimizations.
|
||||
*/
|
||||
void SetContentFlags(uint32_t aFlags)
|
||||
@ -1323,10 +1323,10 @@ public:
|
||||
virtual void Disconnect() {}
|
||||
|
||||
/**
|
||||
* Dynamic downcast to a Thebes layer. Returns null if this is not
|
||||
* a ThebesLayer.
|
||||
* Dynamic downcast to a PaintedLayer. Returns null if this is not
|
||||
* a PaintedLayer.
|
||||
*/
|
||||
virtual ThebesLayer* AsThebesLayer() { return nullptr; }
|
||||
virtual PaintedLayer* AsPaintedLayer() { return nullptr; }
|
||||
|
||||
/**
|
||||
* Dynamic cast to a ContainerLayer. Returns null if this is not
|
||||
@ -1655,17 +1655,17 @@ protected:
|
||||
};
|
||||
|
||||
/**
|
||||
* A Layer which we can draw into using Thebes. It is a conceptually
|
||||
* infinite surface, but each ThebesLayer has an associated "valid region"
|
||||
* of contents that it is currently storing, which is finite. ThebesLayer
|
||||
* A Layer which we can paint into. It is a conceptually
|
||||
* infinite surface, but each PaintedLayer has an associated "valid region"
|
||||
* of contents that it is currently storing, which is finite. PaintedLayer
|
||||
* implementations can store content between paints.
|
||||
*
|
||||
* ThebesLayers are rendered into during the drawing phase of a transaction.
|
||||
* PaintedLayers are rendered into during the drawing phase of a transaction.
|
||||
*
|
||||
* Currently the contents of a ThebesLayer are in the device output color
|
||||
* Currently the contents of a PaintedLayer are in the device output color
|
||||
* space.
|
||||
*/
|
||||
class ThebesLayer : public Layer {
|
||||
class PaintedLayer : public Layer {
|
||||
public:
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
@ -1678,7 +1678,7 @@ public:
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Set whether ComputeEffectiveTransforms should compute the
|
||||
* "residual translation" --- the translation that should be applied *before*
|
||||
* mEffectiveTransform to get the ideal transform for this ThebesLayer.
|
||||
* mEffectiveTransform to get the ideal transform for this PaintedLayer.
|
||||
* When this is true, ComputeEffectiveTransforms will compute the residual
|
||||
* and ensure that the layer is invalidated whenever the residual changes.
|
||||
* When it's false, a change in the residual will not trigger invalidation
|
||||
@ -1693,9 +1693,9 @@ public:
|
||||
*/
|
||||
const nsIntRegion& GetValidRegion() const { return mValidRegion; }
|
||||
|
||||
virtual ThebesLayer* AsThebesLayer() { return this; }
|
||||
virtual PaintedLayer* AsPaintedLayer() { return this; }
|
||||
|
||||
MOZ_LAYER_DECL_NAME("ThebesLayer", TYPE_THEBES)
|
||||
MOZ_LAYER_DECL_NAME("PaintedLayer", TYPE_PAINTED)
|
||||
|
||||
virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface)
|
||||
{
|
||||
@ -1717,13 +1717,13 @@ public:
|
||||
ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
|
||||
}
|
||||
|
||||
LayerManager::ThebesLayerCreationHint GetCreationHint() const { return mCreationHint; }
|
||||
LayerManager::PaintedLayerCreationHint GetCreationHint() const { return mCreationHint; }
|
||||
|
||||
bool UsedForReadback() { return mUsedForReadback; }
|
||||
void SetUsedForReadback(bool aUsed) { mUsedForReadback = aUsed; }
|
||||
/**
|
||||
* Returns the residual translation. Apply this translation when drawing
|
||||
* into the ThebesLayer so that when mEffectiveTransform is applied afterwards
|
||||
* into the PaintedLayer so that when mEffectiveTransform is applied afterwards
|
||||
* by layer compositing, the results exactly match the "ideal transform"
|
||||
* (the product of the transform of this layer and its ancestors).
|
||||
* Returns 0,0 unless SetAllowResidualTranslation(true) has been called.
|
||||
@ -1732,8 +1732,8 @@ public:
|
||||
gfxPoint GetResidualTranslation() const { return mResidualTranslation; }
|
||||
|
||||
protected:
|
||||
ThebesLayer(LayerManager* aManager, void* aImplData,
|
||||
LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE)
|
||||
PaintedLayer(LayerManager* aManager, void* aImplData,
|
||||
LayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE)
|
||||
: Layer(aManager, aImplData)
|
||||
, mValidRegion()
|
||||
, mCreationHint(aCreationHint)
|
||||
@ -1757,9 +1757,9 @@ protected:
|
||||
/**
|
||||
* The creation hint that was used when constructing this layer.
|
||||
*/
|
||||
const LayerManager::ThebesLayerCreationHint mCreationHint;
|
||||
const LayerManager::PaintedLayerCreationHint mCreationHint;
|
||||
/**
|
||||
* Set when this ThebesLayer is participating in readback, i.e. some
|
||||
* Set when this PaintedLayer is participating in readback, i.e. some
|
||||
* ReadbackLayer (may) be getting its background from this layer.
|
||||
*/
|
||||
bool mUsedForReadback;
|
||||
@ -2127,8 +2127,8 @@ public:
|
||||
{
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(GetLocalTransform(), gfxRect(0, 0, mBounds.width, mBounds.height),
|
||||
nullptr)*
|
||||
|
@ -91,8 +91,8 @@ public:
|
||||
{
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(GetLocalTransform(), gfxRect(0, 0, mSize.width, mSize.height),
|
||||
nullptr)*
|
||||
@ -140,7 +140,7 @@ public:
|
||||
mSink = nullptr;
|
||||
}
|
||||
|
||||
void NotifyThebesLayerRemoved(ThebesLayer* aLayer)
|
||||
void NotifyPaintedLayerRemoved(PaintedLayer* aLayer)
|
||||
{
|
||||
if (mBackgroundLayer == aLayer) {
|
||||
mBackgroundLayer = nullptr;
|
||||
@ -182,14 +182,14 @@ protected:
|
||||
nsAutoPtr<ReadbackSink> mSink;
|
||||
nsIntSize mSize;
|
||||
|
||||
// This can refer to any (earlier) sibling ThebesLayer. That ThebesLayer
|
||||
// must have mUsedForReadback set on it. If the ThebesLayer is removed
|
||||
// for the container, this will be set to null by NotifyThebesLayerRemoved.
|
||||
// This ThebesLayer contains the contents which have previously been reported
|
||||
// to mSink. The ThebesLayer had only an integer translation transform,
|
||||
// This can refer to any (earlier) sibling PaintedLayer. That PaintedLayer
|
||||
// must have mUsedForReadback set on it. If the PaintedLayer is removed
|
||||
// for the container, this will be set to null by NotifyPaintedLayerRemoved.
|
||||
// This PaintedLayer contains the contents which have previously been reported
|
||||
// to mSink. The PaintedLayer had only an integer translation transform,
|
||||
// and it covered the entire readback area. This layer also had only an
|
||||
// integer translation transform.
|
||||
ThebesLayer* mBackgroundLayer;
|
||||
PaintedLayer* mBackgroundLayer;
|
||||
// When mBackgroundLayer is non-null, this is the offset to add to
|
||||
// convert from the coordinates of mBackgroundLayer to the coordinates
|
||||
// of this layer.
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "ReadbackProcessor.h"
|
||||
#include <sys/types.h> // for int32_t
|
||||
#include "Layers.h" // for Layer, ThebesLayer, etc
|
||||
#include "Layers.h" // for Layer, PaintedLayer, etc
|
||||
#include "ReadbackLayer.h" // for ReadbackLayer, ReadbackSink
|
||||
#include "gfxColor.h" // for gfxRGBA
|
||||
#include "gfxContext.h" // for gfxContext
|
||||
@ -77,7 +77,7 @@ FindBackgroundLayer(ReadbackLayer* aLayer, nsIntPoint* aOffset)
|
||||
return nullptr;
|
||||
|
||||
Layer::LayerType type = l->GetType();
|
||||
if (type != Layer::TYPE_COLOR && type != Layer::TYPE_THEBES)
|
||||
if (type != Layer::TYPE_COLOR && type != Layer::TYPE_PAINTED)
|
||||
return nullptr;
|
||||
|
||||
*aOffset = backgroundOffset - transformOffset;
|
||||
@ -119,19 +119,19 @@ ReadbackProcessor::BuildUpdatesForLayer(ReadbackLayer* aLayer)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NS_ASSERTION(newBackground->AsThebesLayer(), "Must be ThebesLayer");
|
||||
ThebesLayer* thebesLayer = static_cast<ThebesLayer*>(newBackground);
|
||||
// updateRect is relative to the ThebesLayer
|
||||
NS_ASSERTION(newBackground->AsPaintedLayer(), "Must be PaintedLayer");
|
||||
PaintedLayer* paintedLayer = static_cast<PaintedLayer*>(newBackground);
|
||||
// updateRect is relative to the PaintedLayer
|
||||
nsIntRect updateRect = aLayer->GetRect() - offset;
|
||||
if (thebesLayer != aLayer->mBackgroundLayer ||
|
||||
if (paintedLayer != aLayer->mBackgroundLayer ||
|
||||
offset != aLayer->mBackgroundLayerOffset) {
|
||||
aLayer->mBackgroundLayer = thebesLayer;
|
||||
aLayer->mBackgroundLayer = paintedLayer;
|
||||
aLayer->mBackgroundLayerOffset = offset;
|
||||
aLayer->mBackgroundColor = gfxRGBA(0,0,0,0);
|
||||
thebesLayer->SetUsedForReadback(true);
|
||||
paintedLayer->SetUsedForReadback(true);
|
||||
} else {
|
||||
nsIntRegion invalid;
|
||||
invalid.Sub(updateRect, thebesLayer->GetValidRegion());
|
||||
invalid.Sub(updateRect, paintedLayer->GetValidRegion());
|
||||
updateRect = invalid.GetBounds();
|
||||
}
|
||||
|
||||
@ -141,11 +141,11 @@ ReadbackProcessor::BuildUpdatesForLayer(ReadbackLayer* aLayer)
|
||||
}
|
||||
|
||||
void
|
||||
ReadbackProcessor::GetThebesLayerUpdates(ThebesLayer* aLayer,
|
||||
ReadbackProcessor::GetPaintedLayerUpdates(PaintedLayer* aLayer,
|
||||
nsTArray<Update>* aUpdates,
|
||||
nsIntRegion* aUpdateRegion)
|
||||
{
|
||||
// All ThebesLayers used for readback are in mAllUpdates (some possibly
|
||||
// All PaintedLayers used for readback are in mAllUpdates (some possibly
|
||||
// with an empty update rect).
|
||||
aLayer->SetUsedForReadback(false);
|
||||
if (aUpdateRegion) {
|
||||
|
@ -17,32 +17,32 @@ namespace layers {
|
||||
|
||||
class ContainerLayer;
|
||||
class ReadbackLayer;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
|
||||
class ReadbackProcessor {
|
||||
public:
|
||||
/**
|
||||
* Called by the container before processing any child layers. Call this
|
||||
* if any child layer might have changed in any way (other than content-only
|
||||
* changes to layers other than ColorLayers and ThebesLayers).
|
||||
* changes to layers other than ColorLayers and PaintedLayers).
|
||||
*
|
||||
* This method recomputes the relationship between ReadbackLayers and
|
||||
* sibling layers, and dispatches changes to ReadbackLayers. Except that
|
||||
* if a ThebesLayer needs its contents sent to some ReadbackLayer, we'll
|
||||
* just record that internally and later the ThebesLayer should call
|
||||
* GetThebesLayerUpdates when it paints, to find out which rectangle needs
|
||||
* if a PaintedLayer needs its contents sent to some ReadbackLayer, we'll
|
||||
* just record that internally and later the PaintedLayer should call
|
||||
* GetPaintedLayerUpdates when it paints, to find out which rectangle needs
|
||||
* to be sent, and the ReadbackLayer it needs to be sent to.
|
||||
*/
|
||||
void BuildUpdates(ContainerLayer* aContainer);
|
||||
|
||||
struct Update {
|
||||
/**
|
||||
* The layer a ThebesLayer should send its contents to.
|
||||
* The layer a PaintedLayer should send its contents to.
|
||||
*/
|
||||
ReadbackLayer* mLayer;
|
||||
/**
|
||||
* The rectangle of content that it should send, in the ThebesLayer's
|
||||
* coordinate system. This rectangle is guaranteed to be in the ThebesLayer's
|
||||
* The rectangle of content that it should send, in the PaintedLayer's
|
||||
* coordinate system. This rectangle is guaranteed to be in the PaintedLayer's
|
||||
* visible region. Translate it to mLayer's coordinate system
|
||||
* by adding mLayer->GetBackgroundLayerOffset().
|
||||
*/
|
||||
@ -54,16 +54,16 @@ public:
|
||||
};
|
||||
/**
|
||||
* Appends any ReadbackLayers that need to be updated, and the rects that
|
||||
* need to be updated, to aUpdates. Only need to call this for ThebesLayers
|
||||
* need to be updated, to aUpdates. Only need to call this for PaintedLayers
|
||||
* that have been marked UsedForReadback().
|
||||
* Each Update's mLayer's mBackgroundLayer will have been set to aLayer.
|
||||
* If a ThebesLayer doesn't call GetThebesLayerUpdates, then all the
|
||||
* ReadbackLayers that needed data from that ThebesLayer will be marked
|
||||
* If a PaintedLayer doesn't call GetPaintedLayerUpdates, then all the
|
||||
* ReadbackLayers that needed data from that PaintedLayer will be marked
|
||||
* as having unknown backgrounds.
|
||||
* @param aUpdateRegion if non-null, this region is set to the union
|
||||
* of the mUpdateRects.
|
||||
*/
|
||||
void GetThebesLayerUpdates(ThebesLayer* aLayer,
|
||||
void GetPaintedLayerUpdates(PaintedLayer* aLayer,
|
||||
nsTArray<Update>* aUpdates,
|
||||
nsIntRegion* aUpdateRegion = nullptr);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "BasicLayersImpl.h" // for ToData
|
||||
#include "BufferUnrotate.h" // for BufferUnrotate
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "Layers.h" // for ThebesLayer, Layer, etc
|
||||
#include "Layers.h" // for PaintedLayer, Layer, etc
|
||||
#include "gfxPlatform.h" // for gfxPlatform
|
||||
#include "gfxPrefs.h" // for gfxPrefs
|
||||
#include "gfxUtils.h" // for gfxUtils
|
||||
@ -203,7 +203,7 @@ RotatedContentBuffer::IsClippingCheap(DrawTarget* aTarget, const nsIntRegion& aR
|
||||
}
|
||||
|
||||
void
|
||||
RotatedContentBuffer::DrawTo(ThebesLayer* aLayer,
|
||||
RotatedContentBuffer::DrawTo(PaintedLayer* aLayer,
|
||||
DrawTarget* aTarget,
|
||||
float aOpacity,
|
||||
CompositionOp aOp,
|
||||
@ -428,7 +428,7 @@ RotatedContentBuffer::FlushBuffers()
|
||||
}
|
||||
|
||||
RotatedContentBuffer::PaintState
|
||||
RotatedContentBuffer::BeginPaint(ThebesLayer* aLayer,
|
||||
RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
PaintState result;
|
||||
|
@ -31,7 +31,7 @@ class Matrix;
|
||||
namespace layers {
|
||||
|
||||
class TextureClient;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
|
||||
/**
|
||||
* This is a cairo/Thebes surface, but with a literal twist. Scrolling
|
||||
@ -115,7 +115,7 @@ protected:
|
||||
gfx::SourceSurface* aMask,
|
||||
const gfx::Matrix* aMaskTransform) const;
|
||||
|
||||
/** The area of the ThebesLayer that is covered by the buffer as a whole */
|
||||
/** The area of the PaintedLayer that is covered by the buffer as a whole */
|
||||
nsIntRect mBufferRect;
|
||||
/**
|
||||
* The x and y rotation of the buffer. Conceptually the buffer
|
||||
@ -169,7 +169,7 @@ protected:
|
||||
};
|
||||
|
||||
/**
|
||||
* This class encapsulates the buffer used to retain ThebesLayer contents,
|
||||
* This class encapsulates the buffer used to retain PaintedLayer contents,
|
||||
* i.e., the contents of the layer's GetVisibleRegion().
|
||||
*/
|
||||
class RotatedContentBuffer : public RotatedBuffer
|
||||
@ -181,7 +181,7 @@ public:
|
||||
/**
|
||||
* Controls the size of the backing buffer of this.
|
||||
* - SizedToVisibleBounds: the backing buffer is exactly the same
|
||||
* size as the bounds of ThebesLayer's visible region
|
||||
* size as the bounds of PaintedLayer's visible region
|
||||
* - ContainsVisibleBounds: the backing buffer is large enough to
|
||||
* fit visible bounds. May be larger.
|
||||
*/
|
||||
@ -267,7 +267,7 @@ public:
|
||||
* will need to call BorrowDrawTargetForPainting multiple times to achieve
|
||||
* this.
|
||||
*/
|
||||
PaintState BeginPaint(ThebesLayer* aLayer,
|
||||
PaintState BeginPaint(PaintedLayer* aLayer,
|
||||
uint32_t aFlags);
|
||||
|
||||
struct DrawIterator {
|
||||
@ -333,7 +333,7 @@ public:
|
||||
* drawn before this is called. The contents of the buffer are drawn
|
||||
* to aTarget.
|
||||
*/
|
||||
void DrawTo(ThebesLayer* aLayer,
|
||||
void DrawTo(PaintedLayer* aLayer,
|
||||
gfx::DrawTarget* aTarget,
|
||||
float aOpacity,
|
||||
gfx::CompositionOp aOp,
|
||||
|
@ -115,7 +115,7 @@ BasicContainerLayer::ChildrenPartitionVisibleRegion(const nsIntRect& aInRect)
|
||||
}
|
||||
|
||||
void
|
||||
BasicContainerLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
BasicContainerLayer::Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback)
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
|
||||
void SetSupportsComponentAlphaChildren(bool aSupports) { mSupportsComponentAlphaChildren = aSupports; }
|
||||
|
||||
virtual void Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -21,7 +21,7 @@ class SurfaceDescriptor;
|
||||
* This is the ImplData for all Basic layers. It also exposes methods
|
||||
* private to the Basic implementation that are common to all Basic layer types.
|
||||
* In particular, there is an internal Paint() method that we can use
|
||||
* to paint the contents of non-Thebes layers.
|
||||
* to paint the contents of non-PaintedLayers.
|
||||
*
|
||||
* The class hierarchy for Basic layers is like this:
|
||||
* BasicImplData
|
||||
@ -31,9 +31,9 @@ class SurfaceDescriptor;
|
||||
* | | | | |
|
||||
* | +-> BasicContainerLayer <--+ | |
|
||||
* | | |
|
||||
* +-> ThebesLayer | |
|
||||
* +-> PaintedLayer | |
|
||||
* | | | |
|
||||
* | +-> BasicThebesLayer <---------+ |
|
||||
* | +-> BasicPaintedLayer <---------+ |
|
||||
* | |
|
||||
* +-> ImageLayer |
|
||||
* | |
|
||||
@ -64,17 +64,17 @@ public:
|
||||
Layer* aMaskLayer) {}
|
||||
|
||||
/**
|
||||
* Like Paint() but called for ThebesLayers with the additional parameters
|
||||
* Like Paint() but called for PaintedLayers with the additional parameters
|
||||
* they need.
|
||||
* If mClipToVisibleRegion is set, then the layer must clip to its
|
||||
* effective visible region (snapped or unsnapped, it doesn't matter).
|
||||
*/
|
||||
virtual void PaintThebes(gfxContext* aContext,
|
||||
Layer* aMasklayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData) {}
|
||||
|
||||
virtual void Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback) {}
|
||||
|
||||
|
@ -126,7 +126,7 @@ ToInsideIntRect(const gfxRect& aRect)
|
||||
class PaintLayerContext {
|
||||
public:
|
||||
PaintLayerContext(gfxContext* aTarget, Layer* aLayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
: mTarget(aTarget)
|
||||
, mTargetMatrixSR(aTarget)
|
||||
@ -196,7 +196,7 @@ public:
|
||||
gfxContext* mTarget;
|
||||
gfxContextMatrixAutoSaveRestore mTargetMatrixSR;
|
||||
Layer* mLayer;
|
||||
LayerManager::DrawThebesLayerCallback mCallback;
|
||||
LayerManager::DrawPaintedLayerCallback mCallback;
|
||||
void* mCallbackData;
|
||||
Matrix mTransform;
|
||||
bool mPushedOpaqueRect;
|
||||
@ -445,7 +445,7 @@ ApplyDoubleBuffering(Layer* aLayer, const nsIntRect& aVisibleRect)
|
||||
}
|
||||
|
||||
void
|
||||
BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
BasicLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -464,7 +464,7 @@ BasicLayerManager::AbortTransaction()
|
||||
}
|
||||
|
||||
bool
|
||||
BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
BasicLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -727,7 +727,7 @@ BasicLayerManager::PaintSelfOrChildren(PaintLayerContext& aPaintContext,
|
||||
/* Only paint ourself, or our children - This optimization relies on this! */
|
||||
Layer* child = aPaintContext.mLayer->GetFirstChild();
|
||||
if (!child) {
|
||||
if (aPaintContext.mLayer->AsThebesLayer()) {
|
||||
if (aPaintContext.mLayer->AsPaintedLayer()) {
|
||||
data->PaintThebes(aGroupTarget, aPaintContext.mLayer->GetMaskLayer(),
|
||||
aPaintContext.mCallback, aPaintContext.mCallbackData);
|
||||
} else {
|
||||
@ -778,7 +778,7 @@ BasicLayerManager::FlushGroup(PaintLayerContext& aPaintContext, bool aNeedsClipT
|
||||
void
|
||||
BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
||||
Layer* aLayer,
|
||||
DrawThebesLayerCallback aCallback,
|
||||
DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
PROFILER_LABEL("BasicLayerManager", "PaintLayer",
|
||||
@ -802,7 +802,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
||||
container->UseIntermediateSurface();
|
||||
BasicImplData* data = ToData(aLayer);
|
||||
bool needsClipToVisibleRegion =
|
||||
data->GetClipToVisibleRegion() && !aLayer->AsThebesLayer();
|
||||
data->GetClipToVisibleRegion() && !aLayer->AsPaintedLayer();
|
||||
NS_ASSERTION(needsGroup || !aLayer->GetFirstChild() ||
|
||||
container->GetOperator() == CompositionOp::OP_OVER,
|
||||
"non-OVER operator should have forced UseIntermediateSurface");
|
||||
|
@ -37,7 +37,7 @@ class ReadbackProcessor;
|
||||
* This is a cairo/Thebes-only, main-thread-only implementation of layers.
|
||||
*
|
||||
* In each transaction, the client sets up the layer tree and then during
|
||||
* the drawing phase, each ThebesLayer is painted directly into the target
|
||||
* the drawing phase, each PaintedLayer is painted directly into the target
|
||||
* context (with appropriate clipping and Push/PopGroups performed
|
||||
* between layers).
|
||||
*/
|
||||
@ -53,16 +53,16 @@ public:
|
||||
/**
|
||||
* Construct a BasicLayerManager which will have no default
|
||||
* target context. SetDefaultTarget or BeginTransactionWithTarget
|
||||
* must be called for any rendering to happen. ThebesLayers will not
|
||||
* must be called for any rendering to happen. PaintedLayers will not
|
||||
* be retained.
|
||||
*/
|
||||
explicit BasicLayerManager(BasicLayerManagerType aType);
|
||||
/**
|
||||
* Construct a BasicLayerManager which will have no default
|
||||
* target context. SetDefaultTarget or BeginTransactionWithTarget
|
||||
* must be called for any rendering to happen. ThebesLayers will be
|
||||
* must be called for any rendering to happen. PaintedLayers will be
|
||||
* retained; that is, we will try to retain the visible contents of
|
||||
* ThebesLayers as cairo surfaces. We create ThebesLayer buffers by
|
||||
* PaintedLayers as cairo surfaces. We create PaintedLayer buffers by
|
||||
* creating similar surfaces to the default target context, or to
|
||||
* aWidget's GetThebesSurface if there is no default target context, or
|
||||
* to the passed-in context if there is no widget and no default
|
||||
@ -102,7 +102,7 @@ public:
|
||||
virtual void BeginTransaction();
|
||||
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
virtual bool ShouldAvoidComponentAlphaLayers() { return IsWidgetLayerManager(); }
|
||||
@ -111,7 +111,7 @@ public:
|
||||
|
||||
virtual void SetRoot(Layer* aLayer);
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer();
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer();
|
||||
@ -169,19 +169,19 @@ protected:
|
||||
// Paints aLayer to mTarget.
|
||||
void PaintLayer(gfxContext* aTarget,
|
||||
Layer* aLayer,
|
||||
DrawThebesLayerCallback aCallback,
|
||||
DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
// Clear the contents of a layer
|
||||
void ClearLayer(Layer* aLayer);
|
||||
|
||||
bool EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
bool EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
void FlashWidgetUpdateArea(gfxContext* aContext);
|
||||
|
||||
// Widget whose surface should be used as the basis for ThebesLayer
|
||||
// Widget whose surface should be used as the basis for PaintedLayer
|
||||
// buffers.
|
||||
nsIWidget* mWidget;
|
||||
// The default context for BeginTransaction.
|
||||
|
@ -3,7 +3,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "BasicThebesLayer.h"
|
||||
#include "BasicPaintedLayer.h"
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "ReadbackLayer.h" // for ReadbackLayer, ReadbackSink
|
||||
@ -45,12 +45,12 @@ IntersectWithClip(const nsIntRegion& aRegion, gfxContext* aContext)
|
||||
}
|
||||
|
||||
void
|
||||
BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
||||
BasicPaintedLayer::PaintThebes(gfxContext* aContext,
|
||||
Layer* aMaskLayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
PROFILER_LABEL("BasicThebesLayer", "PaintThebes",
|
||||
PROFILER_LABEL("BasicPaintedLayer", "PaintThebes",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
NS_ASSERTION(BasicManager()->InDrawing(),
|
||||
@ -132,7 +132,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
||||
}
|
||||
|
||||
void
|
||||
BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
BasicPaintedLayer::Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback)
|
||||
{
|
||||
@ -148,7 +148,7 @@ BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates);
|
||||
}
|
||||
|
||||
uint32_t flags = 0;
|
||||
@ -218,11 +218,11 @@ BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
BasicLayerManager::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
BasicLayerManager::CreatePaintedLayer()
|
||||
{
|
||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
||||
nsRefPtr<ThebesLayer> layer = new BasicThebesLayer(this);
|
||||
nsRefPtr<PaintedLayer> layer = new BasicPaintedLayer(this);
|
||||
return layer.forget();
|
||||
}
|
||||
|
@ -3,10 +3,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_BASICTHEBESLAYER_H
|
||||
#define GFX_BASICTHEBESLAYER_H
|
||||
#ifndef GFX_BASICPAINTEDLAYER_H
|
||||
#define GFX_BASICPAINTEDLAYER_H
|
||||
|
||||
#include "Layers.h" // for ThebesLayer, LayerManager, etc
|
||||
#include "Layers.h" // for PaintedLayer, LayerManager, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "BasicImplData.h" // for BasicImplData
|
||||
#include "BasicLayers.h" // for BasicLayerManager
|
||||
@ -25,23 +25,23 @@ namespace layers {
|
||||
|
||||
class ReadbackProcessor;
|
||||
|
||||
class BasicThebesLayer : public ThebesLayer, public BasicImplData {
|
||||
class BasicPaintedLayer : public PaintedLayer, public BasicImplData {
|
||||
public:
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
explicit BasicThebesLayer(BasicLayerManager* aLayerManager) :
|
||||
ThebesLayer(aLayerManager,
|
||||
explicit BasicPaintedLayer(BasicLayerManager* aLayerManager) :
|
||||
PaintedLayer(aLayerManager,
|
||||
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST())),
|
||||
mContentClient(nullptr)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BasicThebesLayer);
|
||||
MOZ_COUNT_CTOR(BasicPaintedLayer);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~BasicThebesLayer()
|
||||
virtual ~BasicPaintedLayer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(BasicThebesLayer);
|
||||
MOZ_COUNT_DTOR(BasicPaintedLayer);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -49,7 +49,7 @@ public:
|
||||
{
|
||||
NS_ASSERTION(BasicManager()->InConstruction(),
|
||||
"Can only set properties in construction phase");
|
||||
ThebesLayer::SetVisibleRegion(aRegion);
|
||||
PaintedLayer::SetVisibleRegion(aRegion);
|
||||
}
|
||||
virtual void InvalidateRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
@ -62,10 +62,10 @@ public:
|
||||
|
||||
virtual void PaintThebes(gfxContext* aContext,
|
||||
Layer* aMaskLayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
virtual void Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback) MOZ_OVERRIDE;
|
||||
|
||||
@ -90,7 +90,7 @@ public:
|
||||
ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
|
||||
return;
|
||||
}
|
||||
ThebesLayer::ComputeEffectiveTransforms(aTransformToSurface);
|
||||
PaintedLayer::ComputeEffectiveTransforms(aTransformToSurface);
|
||||
}
|
||||
|
||||
BasicLayerManager* BasicManager()
|
||||
@ -106,7 +106,7 @@ protected:
|
||||
const nsIntRegion& aRegionToInvalidate,
|
||||
bool aDidSelfCopy,
|
||||
DrawRegionClip aClip,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
if (!aCallback) {
|
@ -16,7 +16,7 @@
|
||||
#include "nsRegion.h" // for nsIntRegion
|
||||
#include "nsTArray.h" // for nsAutoTArray
|
||||
#include "ReadbackProcessor.h"
|
||||
#include "ClientThebesLayer.h"
|
||||
#include "ClientPaintedLayer.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
@ -203,7 +203,7 @@ ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget)
|
||||
mForwarder->BeginTransaction(targetBounds, mTargetRotation, orientation);
|
||||
|
||||
// If we're drawing on behalf of a context with async pan/zoom
|
||||
// enabled, then the entire buffer of thebes layers might be
|
||||
// enabled, then the entire buffer of painted layers might be
|
||||
// composited (including resampling) asynchronously before we get
|
||||
// a chance to repaint, so we have to ensure that it's all valid
|
||||
// and not rotated.
|
||||
@ -233,7 +233,7 @@ ClientLayerManager::BeginTransaction()
|
||||
}
|
||||
|
||||
bool
|
||||
ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
ClientLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags)
|
||||
{
|
||||
@ -257,8 +257,8 @@ ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
// properties.
|
||||
GetRoot()->ApplyPendingUpdatesToSubtree();
|
||||
|
||||
mThebesLayerCallback = aCallback;
|
||||
mThebesLayerCallbackData = aCallbackData;
|
||||
mPaintedLayerCallback = aCallback;
|
||||
mPaintedLayerCallbackData = aCallbackData;
|
||||
|
||||
GetRoot()->ComputeEffectiveTransforms(Matrix4x4());
|
||||
|
||||
@ -267,8 +267,8 @@ ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
GetRoot()->Mutated();
|
||||
}
|
||||
|
||||
mThebesLayerCallback = nullptr;
|
||||
mThebesLayerCallbackData = nullptr;
|
||||
mPaintedLayerCallback = nullptr;
|
||||
mPaintedLayerCallbackData = nullptr;
|
||||
|
||||
// Go back to the construction phase if the transaction isn't complete.
|
||||
// Layout will update the layer tree and call EndTransaction().
|
||||
@ -285,7 +285,7 @@ ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
ClientLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ class nsIWidget;
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class ClientThebesLayer;
|
||||
class ClientPaintedLayer;
|
||||
class CompositorChild;
|
||||
class ImageLayer;
|
||||
class PLayerChild;
|
||||
@ -71,7 +71,7 @@ public:
|
||||
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
|
||||
virtual void BeginTransaction();
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
@ -87,10 +87,10 @@ public:
|
||||
|
||||
virtual void Mutated(Layer* aLayer);
|
||||
|
||||
virtual bool IsOptimizedFor(ThebesLayer* aLayer, ThebesLayerCreationHint aHint);
|
||||
virtual bool IsOptimizedFor(PaintedLayer* aLayer, PaintedLayerCreationHint aHint);
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayerWithHint(ThebesLayerCreationHint aHint);
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayerWithHint(PaintedLayerCreationHint aHint);
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer();
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer();
|
||||
@ -148,11 +148,11 @@ public:
|
||||
|
||||
bool CompositorMightResample() { return mCompositorMightResample; }
|
||||
|
||||
DrawThebesLayerCallback GetThebesLayerCallback() const
|
||||
{ return mThebesLayerCallback; }
|
||||
DrawPaintedLayerCallback GetPaintedLayerCallback() const
|
||||
{ return mPaintedLayerCallback; }
|
||||
|
||||
void* GetThebesLayerCallbackData() const
|
||||
{ return mThebesLayerCallbackData; }
|
||||
void* GetPaintedLayerCallbackData() const
|
||||
{ return mPaintedLayerCallbackData; }
|
||||
|
||||
CompositorChild* GetRemoteRenderer();
|
||||
|
||||
@ -284,7 +284,7 @@ private:
|
||||
|
||||
void ClearLayer(Layer* aLayer);
|
||||
|
||||
bool EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
bool EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags);
|
||||
|
||||
@ -292,10 +292,10 @@ private:
|
||||
|
||||
nsIWidget* mWidget;
|
||||
|
||||
/* Thebes layer callbacks; valid at the end of a transaciton,
|
||||
/* PaintedLayer callbacks; valid at the end of a transaciton,
|
||||
* while rendering */
|
||||
DrawThebesLayerCallback mThebesLayerCallback;
|
||||
void *mThebesLayerCallbackData;
|
||||
DrawPaintedLayerCallback mPaintedLayerCallback;
|
||||
void *mPaintedLayerCallbackData;
|
||||
|
||||
// When we're doing a transaction in order to draw to a non-default
|
||||
// target, the layers transaction is only performed in order to send
|
||||
@ -369,7 +369,7 @@ public:
|
||||
virtual void RenderLayer() = 0;
|
||||
virtual void RenderLayerWithReadback(ReadbackProcessor *aReadback) { RenderLayer(); }
|
||||
|
||||
virtual ClientThebesLayer* AsThebes() { return nullptr; }
|
||||
virtual ClientPaintedLayer* AsThebes() { return nullptr; }
|
||||
|
||||
static inline ClientLayer *
|
||||
ToClientLayer(Layer* aLayer)
|
||||
|
@ -3,8 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "ClientThebesLayer.h"
|
||||
#include "ClientTiledThebesLayer.h" // for ClientTiledThebesLayer
|
||||
#include "ClientPaintedLayer.h"
|
||||
#include "ClientTiledPaintedLayer.h" // for ClientTiledPaintedLayer
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "client/ClientLayerManager.h" // for ClientLayerManager, etc
|
||||
@ -31,9 +31,9 @@ namespace layers {
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
void
|
||||
ClientThebesLayer::PaintThebes()
|
||||
ClientPaintedLayer::PaintThebes()
|
||||
{
|
||||
PROFILER_LABEL("ClientThebesLayer", "PaintThebes",
|
||||
PROFILER_LABEL("ClientPaintedLayer", "PaintThebes",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
NS_ASSERTION(ClientManager()->InDrawing(),
|
||||
@ -54,7 +54,7 @@ ClientThebesLayer::PaintThebes()
|
||||
mContentClient->BeginPaintBuffer(this, flags);
|
||||
mValidRegion.Sub(mValidRegion, state.mRegionToInvalidate);
|
||||
|
||||
if (!state.mRegionToDraw.IsEmpty() && !ClientManager()->GetThebesLayerCallback()) {
|
||||
if (!state.mRegionToDraw.IsEmpty() && !ClientManager()->GetPaintedLayerCallback()) {
|
||||
ClientManager()->SetTransactionIncomplete();
|
||||
return;
|
||||
}
|
||||
@ -73,12 +73,12 @@ ClientThebesLayer::PaintThebes()
|
||||
|
||||
nsRefPtr<gfxContext> ctx = gfxContext::ContextForDrawTarget(target);
|
||||
|
||||
ClientManager()->GetThebesLayerCallback()(this,
|
||||
ClientManager()->GetPaintedLayerCallback()(this,
|
||||
ctx,
|
||||
iter.mDrawRegion,
|
||||
state.mClip,
|
||||
state.mRegionToInvalidate,
|
||||
ClientManager()->GetThebesLayerCallbackData());
|
||||
ClientManager()->GetPaintedLayerCallbackData());
|
||||
|
||||
ctx = nullptr;
|
||||
mContentClient->ReturnDrawTargetToBuffer(target);
|
||||
@ -104,7 +104,7 @@ ClientThebesLayer::PaintThebes()
|
||||
}
|
||||
|
||||
void
|
||||
ClientThebesLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
ClientPaintedLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
{
|
||||
if (GetMaskLayer()) {
|
||||
ToClientLayer(GetMaskLayer())->RenderLayer();
|
||||
@ -123,7 +123,7 @@ ClientThebesLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
nsIntRegion readbackRegion;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates);
|
||||
}
|
||||
|
||||
IntPoint origin(mVisibleRegion.GetBounds().x, mVisibleRegion.GetBounds().y);
|
||||
@ -133,7 +133,7 @@ ClientThebesLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
}
|
||||
|
||||
bool
|
||||
ClientLayerManager::IsOptimizedFor(ThebesLayer* aLayer, ThebesLayerCreationHint aHint)
|
||||
ClientLayerManager::IsOptimizedFor(PaintedLayer* aLayer, PaintedLayerCreationHint aHint)
|
||||
{
|
||||
#ifdef MOZ_B2G
|
||||
// The only creation hint is whether the layer is scrollable or not, and this
|
||||
@ -148,14 +148,14 @@ ClientLayerManager::IsOptimizedFor(ThebesLayer* aLayer, ThebesLayerCreationHint
|
||||
#endif
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
ClientLayerManager::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
ClientLayerManager::CreatePaintedLayer()
|
||||
{
|
||||
return CreateThebesLayerWithHint(NONE);
|
||||
return CreatePaintedLayerWithHint(NONE);
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
ClientLayerManager::CreateThebesLayerWithHint(ThebesLayerCreationHint aHint)
|
||||
already_AddRefed<PaintedLayer>
|
||||
ClientLayerManager::CreatePaintedLayerWithHint(PaintedLayerCreationHint aHint)
|
||||
{
|
||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
||||
if (
|
||||
@ -166,12 +166,12 @@ ClientLayerManager::CreateThebesLayerWithHint(ThebesLayerCreationHint aHint)
|
||||
(AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_OPENGL ||
|
||||
AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D9 ||
|
||||
AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D11)) {
|
||||
nsRefPtr<ClientTiledThebesLayer> layer = new ClientTiledThebesLayer(this, aHint);
|
||||
CREATE_SHADOW(Thebes);
|
||||
nsRefPtr<ClientTiledPaintedLayer> layer = new ClientTiledPaintedLayer(this, aHint);
|
||||
CREATE_SHADOW(Painted);
|
||||
return layer.forget();
|
||||
} else {
|
||||
nsRefPtr<ClientThebesLayer> layer = new ClientThebesLayer(this, aHint);
|
||||
CREATE_SHADOW(Thebes);
|
||||
nsRefPtr<ClientPaintedLayer> layer = new ClientPaintedLayer(this, aHint);
|
||||
CREATE_SHADOW(Painted);
|
||||
return layer.forget();
|
||||
}
|
||||
}
|
@ -3,11 +3,11 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_CLIENTTHEBESLAYER_H
|
||||
#define GFX_CLIENTTHEBESLAYER_H
|
||||
#ifndef GFX_CLIENTPAINTEDLAYER_H
|
||||
#define GFX_CLIENTPAINTEDLAYER_H
|
||||
|
||||
#include "ClientLayerManager.h" // for ClientLayerManager, etc
|
||||
#include "Layers.h" // for ThebesLayer, etc
|
||||
#include "Layers.h" // for PaintedLayer, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
@ -16,7 +16,7 @@
|
||||
#include "nsDebug.h" // for NS_ASSERTION
|
||||
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
||||
#include "nsRegion.h" // for nsIntRegion
|
||||
#include "mozilla/layers/PLayerTransaction.h" // for ThebesLayerAttributes
|
||||
#include "mozilla/layers/PLayerTransaction.h" // for PaintedLayerAttributes
|
||||
|
||||
class gfxContext;
|
||||
|
||||
@ -27,30 +27,30 @@ class CompositableClient;
|
||||
class ShadowableLayer;
|
||||
class SpecificLayerAttributes;
|
||||
|
||||
class ClientThebesLayer : public ThebesLayer,
|
||||
class ClientPaintedLayer : public PaintedLayer,
|
||||
public ClientLayer {
|
||||
public:
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
explicit ClientThebesLayer(ClientLayerManager* aLayerManager,
|
||||
LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE) :
|
||||
ThebesLayer(aLayerManager,
|
||||
explicit ClientPaintedLayer(ClientLayerManager* aLayerManager,
|
||||
LayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE) :
|
||||
PaintedLayer(aLayerManager,
|
||||
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
aCreationHint),
|
||||
mContentClient(nullptr)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ClientThebesLayer);
|
||||
MOZ_COUNT_CTOR(ClientPaintedLayer);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~ClientThebesLayer()
|
||||
virtual ~ClientPaintedLayer()
|
||||
{
|
||||
if (mContentClient) {
|
||||
mContentClient->OnDetach();
|
||||
mContentClient = nullptr;
|
||||
}
|
||||
MOZ_COUNT_DTOR(ClientThebesLayer);
|
||||
MOZ_COUNT_DTOR(ClientPaintedLayer);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -58,7 +58,7 @@ public:
|
||||
{
|
||||
NS_ASSERTION(ClientManager()->InConstruction(),
|
||||
"Can only set properties in construction phase");
|
||||
ThebesLayer::SetVisibleRegion(aRegion);
|
||||
PaintedLayer::SetVisibleRegion(aRegion);
|
||||
}
|
||||
virtual void InvalidateRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
@ -84,7 +84,7 @@ public:
|
||||
|
||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
aAttrs = ThebesLayerAttributes(GetValidRegion());
|
||||
aAttrs = PaintedLayerAttributes(GetValidRegion());
|
||||
}
|
||||
|
||||
ClientLayerManager* ClientManager()
|
@ -2,7 +2,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "ClientTiledThebesLayer.h"
|
||||
#include "ClientTiledPaintedLayer.h"
|
||||
#include "FrameMetrics.h" // for FrameMetrics
|
||||
#include "Units.h" // for ScreenIntRect, CSSPoint, etc
|
||||
#include "UnitTransforms.h" // for TransformTo
|
||||
@ -24,25 +24,25 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
|
||||
ClientTiledThebesLayer::ClientTiledThebesLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::ThebesLayerCreationHint aCreationHint)
|
||||
: ThebesLayer(aManager,
|
||||
ClientTiledPaintedLayer::ClientTiledPaintedLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::PaintedLayerCreationHint aCreationHint)
|
||||
: PaintedLayer(aManager,
|
||||
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
aCreationHint)
|
||||
, mContentClient()
|
||||
{
|
||||
MOZ_COUNT_CTOR(ClientTiledThebesLayer);
|
||||
MOZ_COUNT_CTOR(ClientTiledPaintedLayer);
|
||||
mPaintData.mLastScrollOffset = ParentLayerPoint(0, 0);
|
||||
mPaintData.mFirstPaint = true;
|
||||
}
|
||||
|
||||
ClientTiledThebesLayer::~ClientTiledThebesLayer()
|
||||
ClientTiledPaintedLayer::~ClientTiledPaintedLayer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(ClientTiledThebesLayer);
|
||||
MOZ_COUNT_DTOR(ClientTiledPaintedLayer);
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::ClearCachedResources()
|
||||
ClientTiledPaintedLayer::ClearCachedResources()
|
||||
{
|
||||
if (mContentClient) {
|
||||
mContentClient->ClearCachedResources();
|
||||
@ -52,9 +52,9 @@ ClientTiledThebesLayer::ClearCachedResources()
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
ClientTiledPaintedLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
aAttrs = ThebesLayerAttributes(GetValidRegion());
|
||||
aAttrs = PaintedLayerAttributes(GetValidRegion());
|
||||
}
|
||||
|
||||
static LayerRect
|
||||
@ -81,7 +81,7 @@ GetTransformToAncestorsParentLayer(Layer* aStart, const LayerMetricsWrapper& aAn
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::GetAncestorLayers(LayerMetricsWrapper* aOutScrollAncestor,
|
||||
ClientTiledPaintedLayer::GetAncestorLayers(LayerMetricsWrapper* aOutScrollAncestor,
|
||||
LayerMetricsWrapper* aOutDisplayPortAncestor)
|
||||
{
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
@ -107,7 +107,7 @@ ClientTiledThebesLayer::GetAncestorLayers(LayerMetricsWrapper* aOutScrollAncesto
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::BeginPaint()
|
||||
ClientTiledPaintedLayer::BeginPaint()
|
||||
{
|
||||
mPaintData.mLowPrecisionPaintCount = 0;
|
||||
mPaintData.mPaintFinished = false;
|
||||
@ -132,7 +132,7 @@ ClientTiledThebesLayer::BeginPaint()
|
||||
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_B2G)
|
||||
// Both Android and b2g are guaranteed to have a displayport set, so this
|
||||
// should never happen.
|
||||
NS_WARNING("Tiled Thebes layer with no scrollable container ancestor");
|
||||
NS_WARNING("Tiled PaintedLayer with no scrollable container ancestor");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -184,7 +184,7 @@ ClientTiledThebesLayer::BeginPaint()
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledThebesLayer::UseFastPath()
|
||||
ClientTiledPaintedLayer::UseFastPath()
|
||||
{
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
@ -201,9 +201,9 @@ ClientTiledThebesLayer::UseFastPath()
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledThebesLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
ClientTiledPaintedLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
// If we have no high-precision stuff to draw, or we have started drawing low-precision
|
||||
@ -248,9 +248,9 @@ ClientTiledThebesLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledThebesLayer::RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
ClientTiledPaintedLayer::RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
// Render the low precision buffer, if the visible region is larger than the
|
||||
@ -310,7 +310,7 @@ ClientTiledThebesLayer::RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::EndPaint()
|
||||
ClientTiledPaintedLayer::EndPaint()
|
||||
{
|
||||
mPaintData.mLastScrollOffset = mPaintData.mScrollOffset;
|
||||
mPaintData.mPaintFinished = true;
|
||||
@ -319,11 +319,11 @@ ClientTiledThebesLayer::EndPaint()
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::RenderLayer()
|
||||
ClientTiledPaintedLayer::RenderLayer()
|
||||
{
|
||||
LayerManager::DrawThebesLayerCallback callback =
|
||||
ClientManager()->GetThebesLayerCallback();
|
||||
void *data = ClientManager()->GetThebesLayerCallbackData();
|
||||
LayerManager::DrawPaintedLayerCallback callback =
|
||||
ClientManager()->GetPaintedLayerCallback();
|
||||
void *data = ClientManager()->GetPaintedLayerCallbackData();
|
||||
if (!callback) {
|
||||
ClientManager()->SetTransactionIncomplete();
|
||||
return;
|
@ -2,11 +2,11 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_CLIENTTILEDTHEBESLAYER_H
|
||||
#define GFX_CLIENTTILEDTHEBESLAYER_H
|
||||
#ifndef GFX_CLIENTTILEDPAINTEDLAYER_H
|
||||
#define GFX_CLIENTTILEDPAINTEDLAYER_H
|
||||
|
||||
#include "ClientLayerManager.h" // for ClientLayer, etc
|
||||
#include "Layers.h" // for ThebesLayer, etc
|
||||
#include "Layers.h" // for PaintedLayer, etc
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/layers/TiledContentClient.h"
|
||||
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
||||
@ -21,12 +21,12 @@ class ShadowableLayer;
|
||||
class SpecificLayerAttributes;
|
||||
|
||||
/**
|
||||
* An implementation of ThebesLayer that ONLY supports remote
|
||||
* composition that is backed by tiles. This thebes layer implementation
|
||||
* An implementation of PaintedLayer that ONLY supports remote
|
||||
* composition that is backed by tiles. This painted layer implementation
|
||||
* is better suited to mobile hardware to work around slow implementation
|
||||
* of glTexImage2D (for OGL compositors), and restrait memory bandwidth.
|
||||
*
|
||||
* Tiled Thebes layers use a different protocol compared with other
|
||||
* Tiled PaintedLayers use a different protocol compared with other
|
||||
* layers. A copy of the tiled buffer is made and sent to the compositing
|
||||
* thread via the layers protocol. Tiles are uploaded by the buffers
|
||||
* asynchonously without using IPC, that means they are not safe for cross-
|
||||
@ -35,23 +35,23 @@ class SpecificLayerAttributes;
|
||||
*
|
||||
* There is no ContentClient for tiled layers. There is a ContentHost, however.
|
||||
*/
|
||||
class ClientTiledThebesLayer : public ThebesLayer,
|
||||
class ClientTiledPaintedLayer : public PaintedLayer,
|
||||
public ClientLayer
|
||||
{
|
||||
typedef ThebesLayer Base;
|
||||
typedef PaintedLayer Base;
|
||||
|
||||
public:
|
||||
explicit ClientTiledThebesLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE);
|
||||
explicit ClientTiledPaintedLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE);
|
||||
|
||||
protected:
|
||||
~ClientTiledThebesLayer();
|
||||
~ClientTiledPaintedLayer();
|
||||
|
||||
public:
|
||||
// Override name to distinguish it from ClientThebesLayer in layer dumps
|
||||
virtual const char* Name() const { return "TiledThebesLayer"; }
|
||||
// Override name to distinguish it from ClientPaintedLayer in layer dumps
|
||||
virtual const char* Name() const { return "TiledPaintedLayer"; }
|
||||
|
||||
// Thebes Layer
|
||||
// PaintedLayer
|
||||
virtual Layer* AsLayer() { return this; }
|
||||
virtual void InvalidateRegion(const nsIntRegion& aRegion) {
|
||||
mInvalidRegion.Or(mInvalidRegion, aRegion);
|
||||
@ -104,7 +104,7 @@ private:
|
||||
*/
|
||||
bool RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
/**
|
||||
@ -113,7 +113,7 @@ private:
|
||||
*/
|
||||
bool RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
/**
|
@ -110,7 +110,7 @@ private:
|
||||
* by this layer forwarder (the matching uses a global map on the compositor side,
|
||||
* see CompositableMap in ImageBridgeParent.cpp)
|
||||
*
|
||||
* Subclasses: Thebes layers use ContentClients, ImageLayers use ImageClients,
|
||||
* Subclasses: Painted layers use ContentClients, ImageLayers use ImageClients,
|
||||
* Canvas layers use CanvasClients (but ImageHosts). We have a different subclass
|
||||
* where we have a different way of interfacing with the textures - in terms of
|
||||
* drawing into the compositable and/or passing its contents to the compostior.
|
||||
|
@ -676,7 +676,7 @@ ContentClientIncremental::NotifyBufferCreated(ContentType aType, TextureFlags aF
|
||||
}
|
||||
|
||||
RotatedContentBuffer::PaintState
|
||||
ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
ContentClientIncremental::BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
mTextureInfo.mDeprecatedTextureHostFlags = DeprecatedTextureHostFlags::DEFAULT;
|
||||
|
@ -38,20 +38,20 @@ class DrawTarget;
|
||||
namespace layers {
|
||||
|
||||
class BasicLayerManager;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
|
||||
/**
|
||||
* A compositable client for Thebes layers. These are different to Image/Canvas
|
||||
* A compositable client for PaintedLayers. These are different to Image/Canvas
|
||||
* clients due to sending a valid region across IPC and because we do a lot more
|
||||
* optimisation work, encapsualted in RotatedContentBuffers.
|
||||
*
|
||||
* We use content clients for OMTC and non-OMTC, basic rendering so that
|
||||
* BasicThebesLayer has only one interface to deal with. We support single and
|
||||
* BasicPaintedLayer has only one interface to deal with. We support single and
|
||||
* double buffered flavours. For tiled layers, we do not use a ContentClient
|
||||
* although we do have a ContentHost, and we do use texture clients and texture
|
||||
* hosts.
|
||||
*
|
||||
* The interface presented by ContentClient is used by the BasicThebesLayer
|
||||
* The interface presented by ContentClient is used by the BasicPaintedLayer
|
||||
* methods - PaintThebes, which is the same for MT and OMTC, and PaintBuffer
|
||||
* which is different (the OMTC one does a little more). The 'buffer' in the
|
||||
* names of a lot of these method is actually the TextureClient. But, 'buffer'
|
||||
@ -91,7 +91,7 @@ public:
|
||||
|
||||
|
||||
virtual void Clear() = 0;
|
||||
virtual RotatedContentBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual RotatedContentBuffer::PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) = 0;
|
||||
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(RotatedContentBuffer::PaintState& aPaintState,
|
||||
RotatedContentBuffer::DrawIterator* aIter = nullptr) = 0;
|
||||
@ -133,7 +133,7 @@ public:
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
virtual void Clear() { RotatedContentBuffer::Clear(); }
|
||||
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) MOZ_OVERRIDE
|
||||
{
|
||||
return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
|
||||
@ -148,7 +148,7 @@ public:
|
||||
BorrowDrawTarget::ReturnDrawTarget(aReturned);
|
||||
}
|
||||
|
||||
void DrawTo(ThebesLayer* aLayer,
|
||||
void DrawTo(PaintedLayer* aLayer,
|
||||
gfx::DrawTarget* aTarget,
|
||||
float aOpacity,
|
||||
gfx::CompositionOp aOp,
|
||||
@ -208,7 +208,7 @@ public:
|
||||
mTextureClientOnWhite = nullptr;
|
||||
}
|
||||
|
||||
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) MOZ_OVERRIDE
|
||||
{
|
||||
return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
|
||||
@ -418,7 +418,7 @@ public:
|
||||
mHasBufferOnWhite = false;
|
||||
}
|
||||
|
||||
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) MOZ_OVERRIDE;
|
||||
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(PaintState& aPaintState,
|
||||
RotatedContentBuffer::DrawIterator* aIter = nullptr) MOZ_OVERRIDE;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "mozilla/layers/TiledContentClient.h"
|
||||
#include <math.h> // for ceil, ceilf, floor
|
||||
#include <algorithm>
|
||||
#include "ClientTiledThebesLayer.h" // for ClientTiledThebesLayer
|
||||
#include "ClientTiledPaintedLayer.h" // for ClientTiledPaintedLayer
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "ClientLayerManager.h" // for ClientLayerManager
|
||||
#include "CompositorChild.h" // for CompositorChild
|
||||
@ -89,15 +89,15 @@ using namespace gfx;
|
||||
namespace layers {
|
||||
|
||||
|
||||
TiledContentClient::TiledContentClient(ClientTiledThebesLayer* aThebesLayer,
|
||||
TiledContentClient::TiledContentClient(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
ClientLayerManager* aManager)
|
||||
: CompositableClient(aManager->AsShadowForwarder())
|
||||
{
|
||||
MOZ_COUNT_CTOR(TiledContentClient);
|
||||
|
||||
mTiledBuffer = ClientTiledLayerBuffer(aThebesLayer, this, aManager,
|
||||
mTiledBuffer = ClientTiledLayerBuffer(aPaintedLayer, this, aManager,
|
||||
&mSharedFrameMetricsHelper);
|
||||
mLowPrecisionTiledBuffer = ClientTiledLayerBuffer(aThebesLayer, this, aManager,
|
||||
mLowPrecisionTiledBuffer = ClientTiledLayerBuffer(aPaintedLayer, this, aManager,
|
||||
&mSharedFrameMetricsHelper);
|
||||
|
||||
mLowPrecisionTiledBuffer.SetResolution(gfxPrefs::LowPrecisionResolution());
|
||||
@ -286,11 +286,11 @@ SharedFrameMetricsHelper::AboutToCheckerboard(const FrameMetrics& aContentMetric
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientTiledLayerBuffer::ClientTiledLayerBuffer(ClientTiledThebesLayer* aThebesLayer,
|
||||
ClientTiledLayerBuffer::ClientTiledLayerBuffer(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
CompositableClient* aCompositableClient,
|
||||
ClientLayerManager* aManager,
|
||||
SharedFrameMetricsHelper* aHelper)
|
||||
: mThebesLayer(aThebesLayer)
|
||||
: mPaintedLayer(aPaintedLayer)
|
||||
, mCompositableClient(aCompositableClient)
|
||||
, mManager(aManager)
|
||||
, mLastPaintContentType(gfxContentType::COLOR)
|
||||
@ -313,24 +313,24 @@ gfxContentType
|
||||
ClientTiledLayerBuffer::GetContentType(SurfaceMode* aMode) const
|
||||
{
|
||||
gfxContentType content =
|
||||
mThebesLayer->CanUseOpaqueSurface() ? gfxContentType::COLOR :
|
||||
mPaintedLayer->CanUseOpaqueSurface() ? gfxContentType::COLOR :
|
||||
gfxContentType::COLOR_ALPHA;
|
||||
SurfaceMode mode = mThebesLayer->GetSurfaceMode();
|
||||
SurfaceMode mode = mPaintedLayer->GetSurfaceMode();
|
||||
|
||||
if (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
|
||||
#if defined(MOZ_GFX_OPTIMIZE_MOBILE) || defined(MOZ_WIDGET_GONK)
|
||||
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
|
||||
}
|
||||
#else
|
||||
if (!mThebesLayer->GetParent() ||
|
||||
!mThebesLayer->GetParent()->SupportsComponentAlphaChildren() ||
|
||||
if (!mPaintedLayer->GetParent() ||
|
||||
!mPaintedLayer->GetParent()->SupportsComponentAlphaChildren() ||
|
||||
!gfxPrefs::TiledDrawTargetEnabled()) {
|
||||
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
|
||||
} else {
|
||||
content = gfxContentType::COLOR;
|
||||
}
|
||||
} else if (mode == SurfaceMode::SURFACE_OPAQUE) {
|
||||
if (mThebesLayer->MayResample()) {
|
||||
if (mPaintedLayer->MayResample()) {
|
||||
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
|
||||
content = gfxContentType::COLOR_ALPHA;
|
||||
}
|
||||
@ -887,11 +887,11 @@ ClientTiledLayerBuffer::GetSurfaceDescriptorTiles()
|
||||
void
|
||||
ClientTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion,
|
||||
const nsIntRegion& aPaintRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
TILING_LOG("TILING %p: PaintThebes painting region %s\n", mThebesLayer, Stringify(aPaintRegion).c_str());
|
||||
TILING_LOG("TILING %p: PaintThebes new valid region %s\n", mThebesLayer, Stringify(aNewValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: PaintThebes painting region %s\n", mPaintedLayer, Stringify(aPaintRegion).c_str());
|
||||
TILING_LOG("TILING %p: PaintThebes new valid region %s\n", mPaintedLayer, Stringify(aNewValidRegion).c_str());
|
||||
|
||||
mCallback = aCallback;
|
||||
mCallbackData = aCallbackData;
|
||||
@ -955,7 +955,7 @@ ClientTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion,
|
||||
PROFILER_LABEL("ClientTiledLayerBuffer", "PaintThebesSingleBufferDraw",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
mCallback(mThebesLayer, ctxt, aPaintRegion, DrawRegionClip::CLIP_NONE, nsIntRegion(), mCallbackData);
|
||||
mCallback(mPaintedLayer, ctxt, aPaintRegion, DrawRegionClip::CLIP_NONE, nsIntRegion(), mCallbackData);
|
||||
}
|
||||
|
||||
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
|
||||
@ -1068,7 +1068,7 @@ ClientTiledLayerBuffer::PostValidate(const nsIntRegion& aPaintRegion)
|
||||
ctx->SetMatrix(
|
||||
ctx->CurrentMatrix().Scale(mResolution, mResolution));
|
||||
|
||||
mCallback(mThebesLayer, ctx, aPaintRegion, DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
|
||||
mCallback(mPaintedLayer, ctx, aPaintRegion, DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
|
||||
mMoz2DTiles.clear();
|
||||
}
|
||||
}
|
||||
@ -1323,7 +1323,7 @@ ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
|
||||
ctxt->CurrentMatrix().Translate(-unscaledTileOrigin.x,
|
||||
-unscaledTileOrigin.y).
|
||||
Scale(mResolution, mResolution));
|
||||
mCallback(mThebesLayer, ctxt,
|
||||
mCallback(mPaintedLayer, ctxt,
|
||||
tileRegion.GetBounds(),
|
||||
DrawRegionClip::CLIP_NONE,
|
||||
nsIntRegion(), mCallbackData);
|
||||
@ -1379,7 +1379,7 @@ ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
|
||||
* basically replaces the nontransient async transform that was injected
|
||||
* in GetTransformToAncestorsParentLayer with the complete async transform.
|
||||
* This function then returns the scroll ancestor's composition bounds,
|
||||
* transformed into the thebes layer's LayerPixel coordinates, accounting
|
||||
* transformed into the painted layer's LayerPixel coordinates, accounting
|
||||
* for the compositor state.
|
||||
*/
|
||||
static LayerRect
|
||||
@ -1432,10 +1432,10 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
nsIntRegion staleRegion;
|
||||
staleRegion.And(aInvalidRegion, aOldValidRegion);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update stale region %s\n", mThebesLayer, Stringify(staleRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update stale region %s\n", mPaintedLayer, Stringify(staleRegion).c_str());
|
||||
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
mThebesLayer->GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
mPaintedLayer->GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
|
||||
// Find out the current view transform to determine which tiles to draw
|
||||
// first, and see if we should just abort this paint. Aborting is usually
|
||||
@ -1467,7 +1467,7 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
#endif
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update view transform %s zoom %f abort %d\n",
|
||||
mThebesLayer, ToString(viewTransform.mTranslation).c_str(), viewTransform.mScale.scale, abortPaint);
|
||||
mPaintedLayer, ToString(viewTransform.mTranslation).c_str(), viewTransform.mScale.scale, abortPaint);
|
||||
|
||||
if (abortPaint) {
|
||||
// We ignore if front-end wants to abort if this is the first,
|
||||
@ -1487,7 +1487,7 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
aPaintData->mTransformToCompBounds,
|
||||
viewTransform);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update transformed compositor bounds %s\n", mThebesLayer, Stringify(transformedCompositionBounds).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update transformed compositor bounds %s\n", mPaintedLayer, Stringify(transformedCompositionBounds).c_str());
|
||||
|
||||
// Compute a "coherent update rect" that we should paint all at once in a
|
||||
// single transaction. This is to avoid rendering glitches on animated
|
||||
@ -1506,7 +1506,7 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
#endif
|
||||
)));
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update final coherency rect %s\n", mThebesLayer, Stringify(coherentUpdateRect).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update final coherency rect %s\n", mPaintedLayer, Stringify(coherentUpdateRect).c_str());
|
||||
|
||||
aRegionToPaint.And(aInvalidRegion, coherentUpdateRect);
|
||||
aRegionToPaint.Or(aRegionToPaint, staleRegion);
|
||||
@ -1522,14 +1522,14 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
paintingVisible = true;
|
||||
}
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update final paint region %s\n", mThebesLayer, Stringify(aRegionToPaint).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update final paint region %s\n", mPaintedLayer, Stringify(aRegionToPaint).c_str());
|
||||
|
||||
// Paint area that's visible and overlaps previously valid content to avoid
|
||||
// visible glitches in animated elements, such as gifs.
|
||||
bool paintInSingleTransaction = paintingVisible && (drawingStale || aPaintData->mFirstPaint);
|
||||
|
||||
TILING_LOG("TILING %p: paintingVisible %d drawingStale %d firstPaint %d singleTransaction %d\n",
|
||||
mThebesLayer, paintingVisible, drawingStale, aPaintData->mFirstPaint, paintInSingleTransaction);
|
||||
mPaintedLayer, paintingVisible, drawingStale, aPaintData->mFirstPaint, paintInSingleTransaction);
|
||||
|
||||
// The following code decides what order to draw tiles in, based on the
|
||||
// current scroll direction of the primary scrollable layer.
|
||||
@ -1599,12 +1599,12 @@ ClientTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
TILING_LOG("TILING %p: Progressive update valid region %s\n", mThebesLayer, Stringify(aValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update invalid region %s\n", mThebesLayer, Stringify(aInvalidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update old valid region %s\n", mThebesLayer, Stringify(aOldValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update valid region %s\n", mPaintedLayer, Stringify(aValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update invalid region %s\n", mPaintedLayer, Stringify(aInvalidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update old valid region %s\n", mPaintedLayer, Stringify(aOldValidRegion).c_str());
|
||||
|
||||
bool repeat = false;
|
||||
bool isBufferChanged = false;
|
||||
@ -1618,7 +1618,7 @@ ClientTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
aPaintData,
|
||||
repeat);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update computed paint region %s repeat %d\n", mThebesLayer, Stringify(regionToPaint).c_str(), repeat);
|
||||
TILING_LOG("TILING %p: Progressive update computed paint region %s repeat %d\n", mPaintedLayer, Stringify(regionToPaint).c_str(), repeat);
|
||||
|
||||
// There's no further work to be done.
|
||||
if (regionToPaint.IsEmpty()) {
|
||||
@ -1641,8 +1641,8 @@ ClientTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
aInvalidRegion.Sub(aInvalidRegion, regionToPaint);
|
||||
} while (repeat);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update final valid region %s buffer changed %d\n", mThebesLayer, Stringify(aValidRegion).c_str(), isBufferChanged);
|
||||
TILING_LOG("TILING %p: Progressive update final invalid region %s\n", mThebesLayer, Stringify(aInvalidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update final valid region %s buffer changed %d\n", mPaintedLayer, Stringify(aValidRegion).c_str(), isBufferChanged);
|
||||
TILING_LOG("TILING %p: Progressive update final invalid region %s\n", mPaintedLayer, Stringify(aInvalidRegion).c_str());
|
||||
|
||||
// Return false if nothing has been drawn, or give what has been drawn
|
||||
// to the shadow layer to upload.
|
||||
|
@ -41,7 +41,7 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class BasicTileDescriptor;
|
||||
class ClientTiledThebesLayer;
|
||||
class ClientTiledPaintedLayer;
|
||||
class ClientLayerManager;
|
||||
|
||||
|
||||
@ -388,12 +388,12 @@ class ClientTiledLayerBuffer
|
||||
friend class TiledLayerBuffer<ClientTiledLayerBuffer, TileClient>;
|
||||
|
||||
public:
|
||||
ClientTiledLayerBuffer(ClientTiledThebesLayer* aThebesLayer,
|
||||
ClientTiledLayerBuffer(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
CompositableClient* aCompositableClient,
|
||||
ClientLayerManager* aManager,
|
||||
SharedFrameMetricsHelper* aHelper);
|
||||
ClientTiledLayerBuffer()
|
||||
: mThebesLayer(nullptr)
|
||||
: mPaintedLayer(nullptr)
|
||||
, mCompositableClient(nullptr)
|
||||
, mManager(nullptr)
|
||||
, mLastPaintContentType(gfxContentType::COLOR)
|
||||
@ -403,7 +403,7 @@ public:
|
||||
|
||||
void PaintThebes(const nsIntRegion& aNewValidRegion,
|
||||
const nsIntRegion& aPaintRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
void ReadUnlock();
|
||||
@ -428,7 +428,7 @@ public:
|
||||
nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
SurfaceDescriptorTiles GetSurfaceDescriptorTiles();
|
||||
@ -456,10 +456,10 @@ protected:
|
||||
|
||||
private:
|
||||
gfxContentType GetContentType(SurfaceMode* aMode = nullptr) const;
|
||||
ClientTiledThebesLayer* mThebesLayer;
|
||||
ClientTiledPaintedLayer* mPaintedLayer;
|
||||
CompositableClient* mCompositableClient;
|
||||
ClientLayerManager* mManager;
|
||||
LayerManager::DrawThebesLayerCallback mCallback;
|
||||
LayerManager::DrawPaintedLayerCallback mCallback;
|
||||
void* mCallbackData;
|
||||
CSSToParentLayerScale mFrameResolution;
|
||||
gfxContentType mLastPaintContentType;
|
||||
@ -504,11 +504,11 @@ class TiledContentClient : public CompositableClient
|
||||
// XXX: for now the layer which owns us interacts directly with our buffers.
|
||||
// We should have a content client for each tiled buffer which manages its
|
||||
// own valid region, resolution, etc. Then we could have a much cleaner
|
||||
// interface and tidy up BasicTiledThebesLayer::PaintThebes (bug 862547).
|
||||
friend class ClientTiledThebesLayer;
|
||||
// interface and tidy up BasicTiledPaintedLayer::PaintThebes (bug 862547).
|
||||
friend class ClientTiledPaintedLayer;
|
||||
|
||||
public:
|
||||
TiledContentClient(ClientTiledThebesLayer* aThebesLayer,
|
||||
TiledContentClient(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
ClientLayerManager* aManager);
|
||||
|
||||
protected:
|
||||
|
@ -24,6 +24,14 @@ namespace layers {
|
||||
|
||||
class Compositor;
|
||||
|
||||
CompositableBackendSpecificData::CompositableBackendSpecificData()
|
||||
: mAllowSharingTextureHost(false)
|
||||
{
|
||||
static uint64_t sNextID = 1;
|
||||
++sNextID;
|
||||
mId = sNextID;
|
||||
}
|
||||
|
||||
/**
|
||||
* IPDL actor used by CompositableHost to match with its corresponding
|
||||
* CompositableClient on the content side.
|
||||
@ -131,7 +139,7 @@ void
|
||||
CompositableHost::RemoveTextureHost(TextureHost* aTexture)
|
||||
{
|
||||
// Clear strong refrence to CompositableBackendSpecificData
|
||||
aTexture->SetCompositableBackendSpecificData(nullptr);
|
||||
aTexture->UnsetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -54,18 +54,34 @@ struct EffectChain;
|
||||
class CompositableBackendSpecificData
|
||||
{
|
||||
protected:
|
||||
virtual ~CompositableBackendSpecificData() { }
|
||||
virtual ~CompositableBackendSpecificData() {}
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(CompositableBackendSpecificData)
|
||||
|
||||
CompositableBackendSpecificData()
|
||||
CompositableBackendSpecificData();
|
||||
|
||||
virtual void ClearData() {}
|
||||
virtual void SetCompositor(Compositor* aCompositor) {}
|
||||
|
||||
bool IsAllowingSharingTextureHost()
|
||||
{
|
||||
return mAllowSharingTextureHost;
|
||||
}
|
||||
|
||||
virtual void SetCompositor(Compositor* aCompositor) {}
|
||||
virtual void ClearData() {}
|
||||
void SetAllowSharingTextureHost(bool aAllow)
|
||||
{
|
||||
mAllowSharingTextureHost = aAllow;
|
||||
}
|
||||
|
||||
uint64_t GetId()
|
||||
{
|
||||
return mId;
|
||||
}
|
||||
|
||||
public:
|
||||
bool mAllowSharingTextureHost;
|
||||
uint64_t mId;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -297,7 +297,7 @@ RenderLayers(ContainerT* aContainer,
|
||||
if (LayerHasCheckerboardingAPZC(layer, &color)) {
|
||||
// Ideally we would want to intersect the checkerboard region from the APZ with the layer bounds
|
||||
// and only fill in that area. However the layer bounds takes into account the base translation
|
||||
// for the thebes layer whereas the checkerboard region does not. One does not simply
|
||||
// for the painted layer whereas the checkerboard region does not. One does not simply
|
||||
// intersect areas in different coordinate spaces. So we do this a little more permissively
|
||||
// and only fill in the background when we know there is checkerboard, which in theory
|
||||
// should only occur transiently.
|
||||
|
@ -47,7 +47,7 @@ class TextureImageTextureSourceOGL;
|
||||
struct TexturedEffect;
|
||||
|
||||
/**
|
||||
* ContentHosts are used for compositing Thebes layers, always matched by a
|
||||
* ContentHosts are used for compositing Painted layers, always matched by a
|
||||
* ContentClient of the same type.
|
||||
*
|
||||
* ContentHosts support only UpdateThebes(), not Update().
|
||||
|
@ -34,12 +34,30 @@ ImageHost::ImageHost(const TextureInfo& aTextureInfo)
|
||||
, mLocked(false)
|
||||
{}
|
||||
|
||||
ImageHost::~ImageHost() {}
|
||||
ImageHost::~ImageHost()
|
||||
{
|
||||
if (mFrontBuffer) {
|
||||
mFrontBuffer->UnsetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ImageHost::SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
{
|
||||
CompositableHost::SetCompositableBackendSpecificData(aBackendData);
|
||||
// ImageHost allows TextureHost sharing among ImageHosts.
|
||||
if (aBackendData) {
|
||||
aBackendData->SetAllowSharingTextureHost(true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ImageHost::UseTextureHost(TextureHost* aTexture)
|
||||
{
|
||||
CompositableHost::UseTextureHost(aTexture);
|
||||
if (mFrontBuffer) {
|
||||
mFrontBuffer->UnsetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
|
||||
}
|
||||
mFrontBuffer = aTexture;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
|
||||
virtual CompositableType GetType() { return mTextureInfo.mCompositableType; }
|
||||
|
||||
virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Composite(EffectChain& aEffectChain,
|
||||
float aOpacity,
|
||||
const gfx::Matrix4x4& aTransform,
|
||||
|
@ -135,8 +135,8 @@ ImageLayerComposite::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransform
|
||||
}
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(local, sourceRect, nullptr) *
|
||||
SnapTransformTranslation(aTransformToSurface, nullptr);
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "Layers.h" // for Layer, ContainerLayer, etc
|
||||
#include "LayerScope.h" // for LayerScope Tool
|
||||
#include "protobuf/LayerScopePacket.pb.h" // for protobuf (LayerScope)
|
||||
#include "ThebesLayerComposite.h" // for ThebesLayerComposite
|
||||
#include "PaintedLayerComposite.h" // for PaintedLayerComposite
|
||||
#include "TiledLayerBuffer.h" // for TiledLayerComposer
|
||||
#include "Units.h" // for ScreenIntRect
|
||||
#include "gfx2DGlue.h" // for ToMatrix4x4
|
||||
@ -212,7 +212,7 @@ LayerManagerComposite::EndEmptyTransaction(EndTransactionFlags aFlags)
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerComposite::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
LayerManagerComposite::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -280,8 +280,8 @@ LayerManagerComposite::CreateOptimalMaskDrawTarget(const IntSize &aSize)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
LayerManagerComposite::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
LayerManagerComposite::CreatePaintedLayer()
|
||||
{
|
||||
NS_RUNTIMEABORT("Should only be called on the drawing side");
|
||||
return nullptr;
|
||||
@ -757,15 +757,15 @@ LayerManagerComposite::ComputeRenderIntegrityInternal(Layer* aLayer,
|
||||
return;
|
||||
}
|
||||
|
||||
// Only thebes layers can be incomplete
|
||||
ThebesLayer* thebesLayer = aLayer->AsThebesLayer();
|
||||
if (!thebesLayer) {
|
||||
// Only painted layers can be incomplete
|
||||
PaintedLayer* paintedLayer = aLayer->AsPaintedLayer();
|
||||
if (!paintedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
// See if there's any incomplete rendering
|
||||
nsIntRegion incompleteRegion = aLayer->GetEffectiveVisibleRegion();
|
||||
incompleteRegion.Sub(incompleteRegion, thebesLayer->GetValidRegion());
|
||||
incompleteRegion.Sub(incompleteRegion, paintedLayer->GetValidRegion());
|
||||
|
||||
if (!incompleteRegion.IsEmpty()) {
|
||||
// Calculate the transform to get between screen and layer space
|
||||
@ -922,14 +922,14 @@ LayerManagerComposite::ComputeRenderIntegrity()
|
||||
return 1.f;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayerComposite>
|
||||
LayerManagerComposite::CreateThebesLayerComposite()
|
||||
already_AddRefed<PaintedLayerComposite>
|
||||
LayerManagerComposite::CreatePaintedLayerComposite()
|
||||
{
|
||||
if (mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
return nullptr;
|
||||
}
|
||||
return nsRefPtr<ThebesLayerComposite>(new ThebesLayerComposite(this)).forget();
|
||||
return nsRefPtr<PaintedLayerComposite>(new PaintedLayerComposite(this)).forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ContainerLayerComposite>
|
||||
|
@ -61,7 +61,7 @@ class ImageLayerComposite;
|
||||
class LayerComposite;
|
||||
class RefLayerComposite;
|
||||
class SurfaceDescriptor;
|
||||
class ThebesLayerComposite;
|
||||
class PaintedLayerComposite;
|
||||
class TiledLayerComposer;
|
||||
class TextRenderer;
|
||||
class CompositingRenderTarget;
|
||||
@ -120,7 +120,7 @@ public:
|
||||
void BeginTransactionWithDrawTarget(gfx::DrawTarget* aTarget, const nsIntRect& aRect);
|
||||
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
|
||||
|
||||
@ -137,12 +137,12 @@ public:
|
||||
|
||||
virtual void ClearCachedResources(Layer* aSubtree = nullptr) MOZ_OVERRIDE;
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<ColorLayer> CreateColorLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() MOZ_OVERRIDE;
|
||||
already_AddRefed<ThebesLayerComposite> CreateThebesLayerComposite();
|
||||
already_AddRefed<PaintedLayerComposite> CreatePaintedLayerComposite();
|
||||
already_AddRefed<ContainerLayerComposite> CreateContainerLayerComposite();
|
||||
already_AddRefed<ImageLayerComposite> CreateImageLayerComposite();
|
||||
already_AddRefed<ColorLayerComposite> CreateColorLayerComposite();
|
||||
|
@ -3,7 +3,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "ThebesLayerComposite.h"
|
||||
#include "PaintedLayerComposite.h"
|
||||
#include "CompositableHost.h" // for TiledLayerProperties, etc
|
||||
#include "FrameMetrics.h" // for FrameMetrics
|
||||
#include "Units.h" // for CSSRect, LayerPixel, etc
|
||||
@ -34,23 +34,23 @@ namespace layers {
|
||||
|
||||
class TiledLayerComposer;
|
||||
|
||||
ThebesLayerComposite::ThebesLayerComposite(LayerManagerComposite *aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
PaintedLayerComposite::PaintedLayerComposite(LayerManagerComposite *aManager)
|
||||
: PaintedLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
, mBuffer(nullptr)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ThebesLayerComposite);
|
||||
MOZ_COUNT_CTOR(PaintedLayerComposite);
|
||||
mImplData = static_cast<LayerComposite*>(this);
|
||||
}
|
||||
|
||||
ThebesLayerComposite::~ThebesLayerComposite()
|
||||
PaintedLayerComposite::~PaintedLayerComposite()
|
||||
{
|
||||
MOZ_COUNT_DTOR(ThebesLayerComposite);
|
||||
MOZ_COUNT_DTOR(PaintedLayerComposite);
|
||||
CleanupResources();
|
||||
}
|
||||
|
||||
bool
|
||||
ThebesLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||
PaintedLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||
{
|
||||
switch (aHost->GetType()) {
|
||||
case CompositableType::BUFFER_CONTENT_INC:
|
||||
@ -65,13 +65,13 @@ ThebesLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::Disconnect()
|
||||
PaintedLayerComposite::Disconnect()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::Destroy()
|
||||
PaintedLayerComposite::Destroy()
|
||||
{
|
||||
if (!mDestroyed) {
|
||||
CleanupResources();
|
||||
@ -80,13 +80,13 @@ ThebesLayerComposite::Destroy()
|
||||
}
|
||||
|
||||
Layer*
|
||||
ThebesLayerComposite::GetLayer()
|
||||
PaintedLayerComposite::GetLayer()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
TiledLayerComposer*
|
||||
ThebesLayerComposite::GetTiledLayerComposer()
|
||||
PaintedLayerComposite::GetTiledLayerComposer()
|
||||
{
|
||||
if (!mBuffer) {
|
||||
return nullptr;
|
||||
@ -96,7 +96,7 @@ ThebesLayerComposite::GetTiledLayerComposer()
|
||||
}
|
||||
|
||||
LayerRenderState
|
||||
ThebesLayerComposite::GetRenderState()
|
||||
PaintedLayerComposite::GetRenderState()
|
||||
{
|
||||
if (!mBuffer || !mBuffer->IsAttached() || mDestroyed) {
|
||||
return LayerRenderState();
|
||||
@ -105,12 +105,12 @@ ThebesLayerComposite::GetRenderState()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
||||
PaintedLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
||||
{
|
||||
if (!mBuffer || !mBuffer->IsAttached()) {
|
||||
return;
|
||||
}
|
||||
PROFILER_LABEL("ThebesLayerComposite", "RenderLayer",
|
||||
PROFILER_LABEL("PaintedLayerComposite", "RenderLayer",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
MOZ_ASSERT(mBuffer->GetCompositor() == mCompositeManager->GetCompositor() &&
|
||||
@ -147,7 +147,7 @@ ThebesLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
||||
}
|
||||
|
||||
CompositableHost*
|
||||
ThebesLayerComposite::GetCompositableHost()
|
||||
PaintedLayerComposite::GetCompositableHost()
|
||||
{
|
||||
if (mBuffer && mBuffer->IsAttached()) {
|
||||
return mBuffer.get();
|
||||
@ -157,7 +157,7 @@ ThebesLayerComposite::GetCompositableHost()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::CleanupResources()
|
||||
PaintedLayerComposite::CleanupResources()
|
||||
{
|
||||
if (mBuffer) {
|
||||
mBuffer->Detach(this);
|
||||
@ -166,16 +166,16 @@ ThebesLayerComposite::CleanupResources()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::GenEffectChain(EffectChain& aEffect)
|
||||
PaintedLayerComposite::GenEffectChain(EffectChain& aEffect)
|
||||
{
|
||||
aEffect.mLayerRef = this;
|
||||
aEffect.mPrimaryEffect = mBuffer->GenEffect(GetEffectFilter());
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
PaintedLayerComposite::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
{
|
||||
ThebesLayer::PrintInfo(aStream, aPrefix);
|
||||
PaintedLayer::PrintInfo(aStream, aPrefix);
|
||||
if (mBuffer && mBuffer->IsAttached()) {
|
||||
aStream << "\n";
|
||||
nsAutoCString pfx(aPrefix);
|
@ -3,8 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_ThebesLayerComposite_H
|
||||
#define GFX_ThebesLayerComposite_H
|
||||
#ifndef GFX_PaintedLayerComposite_H
|
||||
#define GFX_PaintedLayerComposite_H
|
||||
|
||||
#include "Layers.h" // for Layer (ptr only), etc
|
||||
#include "gfxRect.h" // for gfxRect
|
||||
@ -24,23 +24,23 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
/**
|
||||
* Thebes layers use ContentHosts for their compsositable host.
|
||||
* By using different ContentHosts, ThebesLayerComposite support tiled and
|
||||
* non-tiled Thebes layers and single or double buffering.
|
||||
* PaintedLayers use ContentHosts for their compsositable host.
|
||||
* By using different ContentHosts, PaintedLayerComposite support tiled and
|
||||
* non-tiled PaintedLayers and single or double buffering.
|
||||
*/
|
||||
|
||||
class CompositableHost;
|
||||
class ContentHost;
|
||||
class TiledLayerComposer;
|
||||
|
||||
class ThebesLayerComposite : public ThebesLayer,
|
||||
class PaintedLayerComposite : public PaintedLayer,
|
||||
public LayerComposite
|
||||
{
|
||||
public:
|
||||
explicit ThebesLayerComposite(LayerManagerComposite *aManager);
|
||||
explicit PaintedLayerComposite(LayerManagerComposite *aManager);
|
||||
|
||||
protected:
|
||||
virtual ~ThebesLayerComposite();
|
||||
virtual ~PaintedLayerComposite();
|
||||
|
||||
public:
|
||||
virtual void Disconnect() MOZ_OVERRIDE;
|
||||
@ -67,7 +67,7 @@ public:
|
||||
|
||||
virtual void InvalidateRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
NS_RUNTIMEABORT("ThebesLayerComposites can't fill invalidated regions");
|
||||
NS_RUNTIMEABORT("PaintedLayerComposites can't fill invalidated regions");
|
||||
}
|
||||
|
||||
void SetValidRegion(const nsIntRegion& aRegion)
|
||||
@ -77,7 +77,7 @@ public:
|
||||
Mutated();
|
||||
}
|
||||
|
||||
MOZ_LAYER_DECL_NAME("ThebesLayerComposite", TYPE_THEBES)
|
||||
MOZ_LAYER_DECL_NAME("PaintedLayerComposite", TYPE_PAINTED)
|
||||
|
||||
protected:
|
||||
|
||||
@ -92,4 +92,4 @@ private:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_ThebesLayerComposite_H */
|
||||
#endif /* GFX_PaintedLayerComposite_H */
|
@ -291,9 +291,14 @@ TextureHost::CompositorRecycle()
|
||||
void
|
||||
TextureHost::SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
{
|
||||
mCompositableBackendData = aBackendData;
|
||||
mCompositableBackendData = aBackendData;
|
||||
}
|
||||
|
||||
void
|
||||
TextureHost::UnsetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
{
|
||||
mCompositableBackendData = nullptr;
|
||||
}
|
||||
|
||||
TextureHost::TextureHost(TextureFlags aFlags)
|
||||
: mActor(nullptr)
|
||||
@ -327,12 +332,6 @@ TextureHost::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
AppendToString(aStream, mFlags, " [flags=", "]");
|
||||
}
|
||||
|
||||
void
|
||||
TextureSource::SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
{
|
||||
mCompositableBackendData = aBackendData;
|
||||
}
|
||||
|
||||
TextureSource::TextureSource()
|
||||
{
|
||||
MOZ_COUNT_CTOR(TextureSource);
|
||||
|
@ -131,11 +131,6 @@ public:
|
||||
* one device texture and must be tiled internally.
|
||||
*/
|
||||
virtual BigImageIterator* AsBigImageIterator() { return nullptr; }
|
||||
|
||||
virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData);
|
||||
|
||||
protected:
|
||||
RefPtr<CompositableBackendSpecificData> mCompositableBackendData;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -443,6 +438,8 @@ public:
|
||||
|
||||
virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData);
|
||||
|
||||
virtual void UnsetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData);
|
||||
|
||||
// If a texture host holds a reference to shmem, it should override this method
|
||||
// to forget about the shmem _without_ releasing it.
|
||||
virtual void OnShutdown() {}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "TiledContentHost.h"
|
||||
#include "ThebesLayerComposite.h" // for ThebesLayerComposite
|
||||
#include "PaintedLayerComposite.h" // for PaintedLayerComposite
|
||||
#include "mozilla/gfx/BaseSize.h" // for BaseSize
|
||||
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
|
||||
#include "mozilla/layers/Compositor.h" // for Compositor
|
||||
|
@ -166,7 +166,7 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* ContentHost for tiled Thebes layers. Since tiled layers are special snow
|
||||
* ContentHost for tiled PaintedLayers. Since tiled layers are special snow
|
||||
* flakes, we have a unique update process. All the textures that back the
|
||||
* tiles are added in the usual way, but Updated is called on the host side
|
||||
* in response to a message that describes the transaction for every tile.
|
||||
|
@ -24,4 +24,4 @@ public:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_THEBESLAYERD3D10_H */
|
||||
#endif /* GFX_PAINTEDLAYERD3D10_H */
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "ContainerLayerD3D10.h"
|
||||
|
||||
#include "ThebesLayerD3D10.h"
|
||||
#include "PaintedLayerD3D10.h"
|
||||
#include "ReadbackProcessor.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
@ -255,8 +255,8 @@ ContainerLayerD3D10::Validate()
|
||||
|
||||
Layer *layer = GetFirstChild();
|
||||
while (layer) {
|
||||
if (layer->GetType() == TYPE_THEBES) {
|
||||
static_cast<ThebesLayerD3D10*>(layer)->Validate(&readback);
|
||||
if (layer->GetType() == TYPE_PAINTED) {
|
||||
static_cast<PaintedLayerD3D10*>(layer)->Validate(&readback);
|
||||
} else {
|
||||
static_cast<LayerD3D10*>(layer->ImplData())->Validate();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "dxgi.h"
|
||||
|
||||
#include "ContainerLayerD3D10.h"
|
||||
#include "ThebesLayerD3D10.h"
|
||||
#include "PaintedLayerD3D10.h"
|
||||
#include "ColorLayerD3D10.h"
|
||||
#include "CanvasLayerD3D10.h"
|
||||
#include "ReadbackLayerD3D10.h"
|
||||
@ -354,7 +354,7 @@ LayerManagerD3D10::EndEmptyTransaction(EndTransactionFlags aFlags)
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerD3D10::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
LayerManagerD3D10::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -392,10 +392,10 @@ LayerManagerD3D10::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
mTarget = nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
LayerManagerD3D10::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
LayerManagerD3D10::CreatePaintedLayer()
|
||||
{
|
||||
nsRefPtr<ThebesLayer> layer = new ThebesLayerD3D10(this);
|
||||
nsRefPtr<PaintedLayer> layer = new PaintedLayerD3D10(this);
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
|
@ -81,11 +81,11 @@ public:
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
struct CallbackInfo {
|
||||
DrawThebesLayerCallback Callback;
|
||||
DrawPaintedLayerCallback Callback;
|
||||
void *CallbackData;
|
||||
};
|
||||
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
@ -105,7 +105,7 @@ public:
|
||||
return MAX_TEXTURE_SIZE;
|
||||
}
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer();
|
||||
virtual already_AddRefed<ColorLayer> CreateColorLayer();
|
||||
|
@ -9,7 +9,7 @@
|
||||
// typedefs conflicts.
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
|
||||
#include "ThebesLayerD3D10.h"
|
||||
#include "PaintedLayerD3D10.h"
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#include "gfxWindowsPlatform.h"
|
||||
@ -31,27 +31,27 @@ namespace layers {
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
ThebesLayerD3D10::ThebesLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
PaintedLayerD3D10::PaintedLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: PaintedLayer(aManager, nullptr)
|
||||
, LayerD3D10(aManager)
|
||||
, mCurrentSurfaceMode(SurfaceMode::SURFACE_OPAQUE)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D10*>(this);
|
||||
}
|
||||
|
||||
ThebesLayerD3D10::~ThebesLayerD3D10()
|
||||
PaintedLayerD3D10::~PaintedLayerD3D10()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
PaintedLayerD3D10::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
{
|
||||
mInvalidRegion.Or(mInvalidRegion, aRegion);
|
||||
mInvalidRegion.SimplifyOutward(20);
|
||||
mValidRegion.Sub(mValidRegion, mInvalidRegion);
|
||||
}
|
||||
|
||||
void ThebesLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcOffset,
|
||||
void PaintedLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcOffset,
|
||||
ID3D10Texture2D* aDest, const nsIntPoint &aDestOffset,
|
||||
const nsIntRegion &aCopyRegion, nsIntRegion* aValidRegion)
|
||||
{
|
||||
@ -84,7 +84,7 @@ void ThebesLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcO
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::RenderLayer()
|
||||
PaintedLayerD3D10::RenderLayer()
|
||||
{
|
||||
if (!mTexture) {
|
||||
return;
|
||||
@ -145,7 +145,7 @@ ThebesLayerD3D10::RenderLayer()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
PaintedLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
{
|
||||
if (mVisibleRegion.IsEmpty()) {
|
||||
return;
|
||||
@ -189,7 +189,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
nsIntRegion readbackRegion;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
}
|
||||
|
||||
if (mTexture) {
|
||||
@ -243,7 +243,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
if (!drawRegion.IsEmpty()) {
|
||||
LayerManagerD3D10::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
|
||||
if (!cbInfo.Callback) {
|
||||
NS_ERROR("D3D10 should never need to update ThebesLayers in an empty transaction");
|
||||
NS_ERROR("D3D10 should never need to update PaintedLayers in an empty transaction");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -258,7 +258,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
nsRefPtr<ID3D10Texture2D> readbackTexture;
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(readbackTexture));
|
||||
if (FAILED(hr)) {
|
||||
LayerManagerD3D10::ReportFailure(NS_LITERAL_CSTRING("ThebesLayerD3D10::Validate(): Failed to create texture"),
|
||||
LayerManagerD3D10::ReportFailure(NS_LITERAL_CSTRING("PaintedLayerD3D10::Validate(): Failed to create texture"),
|
||||
hr);
|
||||
return;
|
||||
}
|
||||
@ -277,19 +277,19 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::LayerManagerDestroyed()
|
||||
PaintedLayerD3D10::LayerManagerDestroyed()
|
||||
{
|
||||
mD3DManager = nullptr;
|
||||
}
|
||||
|
||||
Layer*
|
||||
ThebesLayerD3D10::GetLayer()
|
||||
PaintedLayerD3D10::GetLayer()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
PaintedLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
{
|
||||
if (mDrawTarget) {
|
||||
SurfaceFormat format = aMode != SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA ?
|
||||
@ -299,7 +299,7 @@ ThebesLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
mDrawTarget = Factory::CreateDrawTargetForD3D10Texture(mTexture, format);
|
||||
|
||||
if (!mDrawTarget) {
|
||||
NS_WARNING("Failed to create drawtarget for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create drawtarget for PaintedLayerD3D10.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ ThebesLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsIntPoint& aOffset)
|
||||
PaintedLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsIntPoint& aOffset)
|
||||
{
|
||||
if (mTexture && mTextureOnWhite) {
|
||||
// It would be more optimal to draw the actual geometry, but more code
|
||||
@ -380,7 +380,7 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
|
||||
PaintedLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
|
||||
{
|
||||
nsIntRect visibleRect = mVisibleRegion.GetBounds();
|
||||
|
||||
@ -413,7 +413,7 @@ ThebesLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode)
|
||||
PaintedLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode)
|
||||
{
|
||||
if (aSize.width == 0 || aSize.height == 0) {
|
||||
// Nothing to do.
|
||||
@ -429,14 +429,14 @@ ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode
|
||||
hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTexture));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for ThebesLayerD3D10!");
|
||||
NS_WARNING("Failed to create new texture for PaintedLayerD3D10!");
|
||||
return;
|
||||
}
|
||||
|
||||
hr = device()->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mSRView));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create shader resource view for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create shader resource view for PaintedLayerD3D10.");
|
||||
}
|
||||
|
||||
mDrawTarget = nullptr;
|
||||
@ -446,14 +446,14 @@ ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode
|
||||
hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTextureOnWhite));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for ThebesLayerD3D10!");
|
||||
NS_WARNING("Failed to create new texture for PaintedLayerD3D10!");
|
||||
return;
|
||||
}
|
||||
|
||||
hr = device()->CreateShaderResourceView(mTextureOnWhite, nullptr, getter_AddRefs(mSRViewOnWhite));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create shader resource view for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create shader resource view for PaintedLayerD3D10.");
|
||||
}
|
||||
|
||||
mDrawTarget = nullptr;
|
||||
@ -468,7 +468,7 @@ ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode
|
||||
}
|
||||
|
||||
if (!mDrawTarget) {
|
||||
NS_WARNING("Failed to create DrawTarget for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create DrawTarget for PaintedLayerD3D10.");
|
||||
mDrawTarget = nullptr;
|
||||
return;
|
||||
}
|
@ -3,24 +3,24 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_THEBESLAYERD3D10_H
|
||||
#define GFX_THEBESLAYERD3D10_H
|
||||
#ifndef GFX_PAINTEDLAYERD3D10_H
|
||||
#define GFX_PAINTEDLAYERD3D10_H
|
||||
|
||||
#include "LayerManagerD3D10.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class ThebesLayerD3D10 : public ThebesLayer,
|
||||
class PaintedLayerD3D10 : public PaintedLayer,
|
||||
public LayerD3D10
|
||||
{
|
||||
public:
|
||||
ThebesLayerD3D10(LayerManagerD3D10 *aManager);
|
||||
virtual ~ThebesLayerD3D10();
|
||||
PaintedLayerD3D10(LayerManagerD3D10 *aManager);
|
||||
virtual ~PaintedLayerD3D10();
|
||||
|
||||
void Validate(ReadbackProcessor *aReadback);
|
||||
|
||||
/* ThebesLayer implementation */
|
||||
/* PaintedLayer implementation */
|
||||
void InvalidateRegion(const nsIntRegion& aRegion);
|
||||
|
||||
/* LayerD3D10 implementation */
|
||||
@ -70,4 +70,4 @@ private:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_THEBESLAYERD3D10_H */
|
||||
#endif /* GFX_PAINTEDLAYERD3D10_H */
|
@ -20,14 +20,14 @@ namespace layers {
|
||||
// mLayer may be released only on the main thread this object should always be
|
||||
// destroyed on the main thread!
|
||||
struct ReadbackTask {
|
||||
// The texture that we copied the contents of the thebeslayer to.
|
||||
// The texture that we copied the contents of the paintedlayer to.
|
||||
nsRefPtr<ID3D10Texture2D> mReadbackTexture;
|
||||
// This exists purely to keep the ReadbackLayer alive for the lifetime of
|
||||
// mUpdate. Note that this addref and release should occur -solely- on the
|
||||
// main thread.
|
||||
nsRefPtr<ReadbackLayer> mLayer;
|
||||
ReadbackProcessor::Update mUpdate;
|
||||
// The origin in ThebesLayer coordinates of mReadbackTexture.
|
||||
// The origin in PaintedLayer coordinates of mReadbackTexture.
|
||||
gfxPoint mOrigin;
|
||||
// mLayer->GetBackgroundOffset() when the task is created. We have
|
||||
// to save this in the ReadbackTask because it might change before
|
||||
@ -64,7 +64,7 @@ public:
|
||||
HRESULT hr = mTask->mReadbackTexture->Map(0, D3D10_MAP_READ, 0, &mappedTex);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
// If this fails we're never going to get our ThebesLayer content.
|
||||
// If this fails we're never going to get our PaintedLayer content.
|
||||
update->mLayer->GetSink()->SetUnknown(update->mSequenceCounter);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
* @param aUpdate ReadbackProcessor::Update object. This is a void pointer
|
||||
* since we cannot forward declare a nested class, and do not
|
||||
* export ReadbackProcessor.h
|
||||
* @param aOrigin Origin of the aTexture surface in the ThebesLayer
|
||||
* @param aOrigin Origin of the aTexture surface in the PaintedLayer
|
||||
* coordinate system.
|
||||
*/
|
||||
void PostTask(ID3D10Texture2D *aTexture, void *aUpdate, const gfxPoint &aOrigin);
|
||||
|
@ -23,7 +23,7 @@ namespace layers {
|
||||
// mSink may be released only on the main thread this object should always be
|
||||
// destroyed on the main thread!
|
||||
struct ReadbackTask {
|
||||
// The texture that we copied the contents of the thebeslayer to.
|
||||
// The texture that we copied the contents of the paintedlayer to.
|
||||
nsRefPtr<ID3D10Texture2D> mReadbackTexture;
|
||||
// The sink that we're trying to read back to.
|
||||
RefPtr<TextureReadbackSink> mSink;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "ContainerLayerD3D9.h"
|
||||
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "ReadbackProcessor.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
@ -173,8 +173,8 @@ ContainerLayerD3D9::RenderLayer()
|
||||
d3drect.bottom = scissorRect.y + scissorRect.height;
|
||||
device()->SetScissorRect(&d3drect);
|
||||
|
||||
if (layerToRender->GetLayer()->GetType() == TYPE_THEBES) {
|
||||
static_cast<ThebesLayerD3D9*>(layerToRender)->RenderThebesLayer(&readback);
|
||||
if (layerToRender->GetLayer()->GetType() == TYPE_PAINTED) {
|
||||
static_cast<PaintedLayerD3D9*>(layerToRender)->RenderPaintedLayer(&readback);
|
||||
} else {
|
||||
layerToRender->RenderLayer();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "DeviceManagerD3D9.h"
|
||||
#include "LayerManagerD3D9Shaders.h"
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIConsoleService.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "gfxSharedImageSurface.h"
|
||||
|
||||
#include "ImageLayerD3D9.h"
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "gfx2DGlue.h"
|
||||
#include "yuv_convert.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "LayerManagerD3D9.h"
|
||||
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "ContainerLayerD3D9.h"
|
||||
#include "ImageLayerD3D9.h"
|
||||
#include "ColorLayerD3D9.h"
|
||||
@ -128,7 +128,7 @@ LayerManagerD3D9::EndEmptyTransaction(EndTransactionFlags aFlags)
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerD3D9::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
LayerManagerD3D9::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -167,10 +167,10 @@ LayerManagerD3D9::SetRoot(Layer *aLayer)
|
||||
mRoot = aLayer;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
LayerManagerD3D9::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
LayerManagerD3D9::CreatePaintedLayer()
|
||||
{
|
||||
nsRefPtr<ThebesLayer> layer = new ThebesLayerD3D9(this);
|
||||
nsRefPtr<PaintedLayer> layer = new PaintedLayerD3D9(this);
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class LayerD3D9;
|
||||
class ThebesLayerD3D9;
|
||||
class PaintedLayerD3D9;
|
||||
|
||||
/*
|
||||
* This is the LayerManager used for Direct3D 9. For now this will render on
|
||||
@ -66,11 +66,11 @@ public:
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
struct CallbackInfo {
|
||||
DrawThebesLayerCallback Callback;
|
||||
DrawPaintedLayerCallback Callback;
|
||||
void *CallbackData;
|
||||
};
|
||||
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
return mDeviceManager->GetMaxTextureSize();
|
||||
}
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
// typedefs conflicts.
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#include "gfxWindowsPlatform.h"
|
||||
@ -24,15 +24,15 @@ namespace layers {
|
||||
|
||||
using namespace gfx;
|
||||
|
||||
ThebesLayerD3D9::ThebesLayerD3D9(LayerManagerD3D9 *aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
PaintedLayerD3D9::PaintedLayerD3D9(LayerManagerD3D9 *aManager)
|
||||
: PaintedLayer(aManager, nullptr)
|
||||
, LayerD3D9(aManager)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D9*>(this);
|
||||
aManager->deviceManager()->mLayersWithResources.AppendElement(this);
|
||||
}
|
||||
|
||||
ThebesLayerD3D9::~ThebesLayerD3D9()
|
||||
PaintedLayerD3D9::~PaintedLayerD3D9()
|
||||
{
|
||||
if (mD3DManager) {
|
||||
mD3DManager->deviceManager()->mLayersWithResources.RemoveElement(this);
|
||||
@ -47,7 +47,7 @@ ThebesLayerD3D9::~ThebesLayerD3D9()
|
||||
#define RETENTION_THRESHOLD 16384
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
PaintedLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
{
|
||||
mInvalidRegion.Or(mInvalidRegion, aRegion);
|
||||
mInvalidRegion.SimplifyOutward(20);
|
||||
@ -55,7 +55,7 @@ ThebesLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffset,
|
||||
PaintedLayerD3D9::CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffset,
|
||||
IDirect3DTexture9* aDest, const nsIntPoint &aDestOffset,
|
||||
const nsIntRegion &aCopyRegion, nsIntRegion* aValidRegion)
|
||||
{
|
||||
@ -97,7 +97,7 @@ ThebesLayerD3D9::CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffse
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::UpdateTextures(SurfaceMode aMode)
|
||||
PaintedLayerD3D9::UpdateTextures(SurfaceMode aMode)
|
||||
{
|
||||
nsIntRect visibleRect = mVisibleRegion.GetBounds();
|
||||
|
||||
@ -141,7 +141,7 @@ ThebesLayerD3D9::UpdateTextures(SurfaceMode aMode)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::RenderRegion(const nsIntRegion& aRegion)
|
||||
PaintedLayerD3D9::RenderRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
nsIntRegionRectIterator iter(aRegion);
|
||||
|
||||
@ -166,7 +166,7 @@ ThebesLayerD3D9::RenderRegion(const nsIntRegion& aRegion)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
PaintedLayerD3D9::RenderPaintedLayer(ReadbackProcessor* aReadback)
|
||||
{
|
||||
if (mVisibleRegion.IsEmpty()) {
|
||||
return;
|
||||
@ -208,10 +208,10 @@ ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
nsIntRegion readbackRegion;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
}
|
||||
|
||||
// Because updates to D3D9 ThebesLayers are rendered with the CPU, we don't
|
||||
// Because updates to D3D9 PaintedLayers are rendered with the CPU, we don't
|
||||
// have to do readback from D3D9 surfaces. Instead we make sure that any area
|
||||
// needed for readback is included in the drawRegion we ask layout to render.
|
||||
// Then the readback areas we need can be copied out of the temporary
|
||||
@ -224,7 +224,7 @@ ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
if (!drawRegion.IsEmpty()) {
|
||||
LayerManagerD3D9::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
|
||||
if (!cbInfo.Callback) {
|
||||
NS_ERROR("D3D9 should never need to update ThebesLayers in an empty transaction");
|
||||
NS_ERROR("D3D9 should never need to update PaintedLayers in an empty transaction");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::CleanResources()
|
||||
PaintedLayerD3D9::CleanResources()
|
||||
{
|
||||
mTexture = nullptr;
|
||||
mTextureOnWhite = nullptr;
|
||||
@ -280,26 +280,26 @@ ThebesLayerD3D9::CleanResources()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::LayerManagerDestroyed()
|
||||
PaintedLayerD3D9::LayerManagerDestroyed()
|
||||
{
|
||||
mD3DManager->deviceManager()->mLayersWithResources.RemoveElement(this);
|
||||
mD3DManager = nullptr;
|
||||
}
|
||||
|
||||
Layer*
|
||||
ThebesLayerD3D9::GetLayer()
|
||||
PaintedLayerD3D9::GetLayer()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
bool
|
||||
ThebesLayerD3D9::IsEmpty()
|
||||
PaintedLayerD3D9::IsEmpty()
|
||||
{
|
||||
return !mTexture;
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::VerifyContentType(SurfaceMode aMode)
|
||||
PaintedLayerD3D9::VerifyContentType(SurfaceMode aMode)
|
||||
{
|
||||
if (!mTexture)
|
||||
return;
|
||||
@ -480,7 +480,7 @@ FillSurface(gfxASurface* aSurface, const nsIntRegion& aRegion,
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
|
||||
PaintedLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
|
||||
const nsTArray<ReadbackProcessor::Update>& aReadbackUpdates)
|
||||
{
|
||||
nsIntRect visibleRect = mVisibleRegion.GetBounds();
|
||||
@ -619,7 +619,7 @@ ThebesLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
PaintedLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
SurfaceMode aMode)
|
||||
{
|
||||
if (aSize.width == 0 || aSize.height == 0) {
|
||||
@ -634,7 +634,7 @@ ThebesLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
aMode != SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA ? D3DFMT_X8R8G8B8 : D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_DEFAULT, getter_AddRefs(mTexture), nullptr);
|
||||
if (FAILED(hr)) {
|
||||
ReportFailure(NS_LITERAL_CSTRING("ThebesLayerD3D9::CreateNewTextures(): Failed to create texture"),
|
||||
ReportFailure(NS_LITERAL_CSTRING("PaintedLayerD3D9::CreateNewTextures(): Failed to create texture"),
|
||||
hr);
|
||||
return;
|
||||
}
|
||||
@ -645,7 +645,7 @@ ThebesLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
D3DFMT_X8R8G8B8,
|
||||
D3DPOOL_DEFAULT, getter_AddRefs(mTextureOnWhite), nullptr);
|
||||
if (FAILED(hr)) {
|
||||
ReportFailure(NS_LITERAL_CSTRING("ThebesLayerD3D9::CreateNewTextures(): Failed to create texture (2)"),
|
||||
ReportFailure(NS_LITERAL_CSTRING("PaintedLayerD3D9::CreateNewTextures(): Failed to create texture (2)"),
|
||||
hr);
|
||||
return;
|
||||
}
|
@ -3,8 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_THEBESLAYERD3D9_H
|
||||
#define GFX_THEBESLAYERD3D9_H
|
||||
#ifndef GFX_PAINTEDLAYERD3D9_H
|
||||
#define GFX_PAINTEDLAYERD3D9_H
|
||||
|
||||
#include "Layers.h"
|
||||
#include "LayerManagerD3D9.h"
|
||||
@ -15,24 +15,24 @@ namespace layers {
|
||||
|
||||
class ReadbackProcessor;
|
||||
|
||||
class ThebesLayerD3D9 : public ThebesLayer,
|
||||
class PaintedLayerD3D9 : public PaintedLayer,
|
||||
public LayerD3D9
|
||||
{
|
||||
public:
|
||||
ThebesLayerD3D9(LayerManagerD3D9 *aManager);
|
||||
virtual ~ThebesLayerD3D9();
|
||||
PaintedLayerD3D9(LayerManagerD3D9 *aManager);
|
||||
virtual ~PaintedLayerD3D9();
|
||||
|
||||
/* ThebesLayer implementation */
|
||||
/* PaintedLayer implementation */
|
||||
void InvalidateRegion(const nsIntRegion& aRegion);
|
||||
|
||||
/* LayerD3D9 implementation */
|
||||
Layer* GetLayer();
|
||||
virtual bool IsEmpty();
|
||||
virtual void RenderLayer() { RenderThebesLayer(nullptr); }
|
||||
virtual void RenderLayer() { RenderPaintedLayer(nullptr); }
|
||||
virtual void CleanResources();
|
||||
virtual void LayerManagerDestroyed();
|
||||
|
||||
void RenderThebesLayer(ReadbackProcessor* aReadback);
|
||||
void RenderPaintedLayer(ReadbackProcessor* aReadback);
|
||||
|
||||
private:
|
||||
/*
|
||||
@ -81,4 +81,4 @@ private:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_THEBESLAYERD3D9_H */
|
||||
#endif /* GFX_PAINTEDLAYERD3D9_H */
|
@ -23,7 +23,7 @@
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG
|
||||
#include "mozilla/layers/TextureHost.h" // for TextureHost
|
||||
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
|
||||
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||
#include "mozilla/layers/PaintedLayerComposite.h"
|
||||
#include "mozilla/mozalloc.h" // for operator delete
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsDebug.h" // for NS_WARNING, NS_ASSERTION
|
||||
@ -88,15 +88,15 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpPaintTextureRegion: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint PaintedLayer"));
|
||||
|
||||
const OpPaintTextureRegion& op = aEdit.get_OpPaintTextureRegion();
|
||||
CompositableHost* compositable = AsCompositable(op);
|
||||
Layer* layer = compositable->GetLayer();
|
||||
if (!layer || layer->GetType() != Layer::TYPE_THEBES) {
|
||||
if (!layer || layer->GetType() != Layer::TYPE_PAINTED) {
|
||||
return false;
|
||||
}
|
||||
ThebesLayerComposite* thebes = static_cast<ThebesLayerComposite*>(layer);
|
||||
PaintedLayerComposite* thebes = static_cast<PaintedLayerComposite*>(layer);
|
||||
|
||||
const ThebesBufferData& bufferData = op.bufferData();
|
||||
|
||||
@ -117,7 +117,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpPaintTextureIncremental: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint PaintedLayer"));
|
||||
|
||||
const OpPaintTextureIncremental& op = aEdit.get_OpPaintTextureIncremental();
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "mozilla/layers/PCompositableParent.h"
|
||||
#include "mozilla/layers/PLayerParent.h" // for PLayerParent
|
||||
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
|
||||
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||
#include "mozilla/layers/PaintedLayerComposite.h"
|
||||
#include "mozilla/mozalloc.h" // for operator delete, etc
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsCoord.h" // for NSAppUnitsToFloatPixels
|
||||
@ -234,12 +234,12 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
|
||||
switch (edit.type()) {
|
||||
// Create* ops
|
||||
case Edit::TOpCreateThebesLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
|
||||
case Edit::TOpCreatePaintedLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreatePaintedLayer"));
|
||||
|
||||
nsRefPtr<ThebesLayerComposite> layer =
|
||||
layer_manager()->CreateThebesLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateThebesLayer())->Bind(layer);
|
||||
nsRefPtr<PaintedLayerComposite> layer =
|
||||
layer_manager()->CreatePaintedLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreatePaintedLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
case Edit::TOpCreateContainerLayer: {
|
||||
@ -329,17 +329,17 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
case Specific::Tnull_t:
|
||||
break;
|
||||
|
||||
case Specific::TThebesLayerAttributes: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
|
||||
case Specific::TPaintedLayerAttributes: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] painted layer"));
|
||||
|
||||
ThebesLayerComposite* thebesLayer = layerParent->AsThebesLayerComposite();
|
||||
if (!thebesLayer) {
|
||||
PaintedLayerComposite* paintedLayer = layerParent->AsPaintedLayerComposite();
|
||||
if (!paintedLayer) {
|
||||
return false;
|
||||
}
|
||||
const ThebesLayerAttributes& attrs =
|
||||
specific.get_ThebesLayerAttributes();
|
||||
const PaintedLayerAttributes& attrs =
|
||||
specific.get_PaintedLayerAttributes();
|
||||
|
||||
thebesLayer->SetValidRegion(attrs.validRegion());
|
||||
paintedLayer->SetValidRegion(attrs.validRegion());
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ struct TargetConfig {
|
||||
};
|
||||
|
||||
// Create a shadow layer for |layer|
|
||||
struct OpCreateThebesLayer { PLayer layer; };
|
||||
struct OpCreatePaintedLayer { PLayer layer; };
|
||||
struct OpCreateContainerLayer { PLayer layer; };
|
||||
struct OpCreateImageLayer { PLayer layer; };
|
||||
struct OpCreateColorLayer { PLayer layer; };
|
||||
@ -219,7 +219,7 @@ struct CommonLayerAttributes {
|
||||
string contentDescription;
|
||||
};
|
||||
|
||||
struct ThebesLayerAttributes {
|
||||
struct PaintedLayerAttributes {
|
||||
nsIntRegion validRegion;
|
||||
};
|
||||
struct ContainerLayerAttributes {
|
||||
@ -235,7 +235,7 @@ struct ImageLayerAttributes { GraphicsFilterType filter; IntSize scaleToSize
|
||||
|
||||
union SpecificLayerAttributes {
|
||||
null_t;
|
||||
ThebesLayerAttributes;
|
||||
PaintedLayerAttributes;
|
||||
ContainerLayerAttributes;
|
||||
ColorLayerAttributes;
|
||||
CanvasLayerAttributes;
|
||||
@ -430,7 +430,7 @@ union CompositableOperation {
|
||||
|
||||
// A unit of a changeset; a set of these comprise a changeset
|
||||
union Edit {
|
||||
OpCreateThebesLayer;
|
||||
OpCreatePaintedLayer;
|
||||
OpCreateContainerLayer;
|
||||
OpCreateImageLayer;
|
||||
OpCreateColorLayer;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
||||
#include "nsISupportsImpl.h" // for Layer::AddRef, etc
|
||||
|
||||
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||
#include "mozilla/layers/PaintedLayerComposite.h"
|
||||
#include "mozilla/layers/CanvasLayerComposite.h"
|
||||
#include "mozilla/layers/ColorLayerComposite.h"
|
||||
#include "mozilla/layers/ImageLayerComposite.h"
|
||||
@ -85,11 +85,11 @@ ShadowLayerParent::AsRefLayerComposite() const
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
ThebesLayerComposite*
|
||||
ShadowLayerParent::AsThebesLayerComposite() const
|
||||
PaintedLayerComposite*
|
||||
ShadowLayerParent::AsPaintedLayerComposite() const
|
||||
{
|
||||
return mLayer && mLayer->GetType() == Layer::TYPE_THEBES
|
||||
? static_cast<ThebesLayerComposite*>(mLayer.get())
|
||||
return mLayer && mLayer->GetType() == Layer::TYPE_PAINTED
|
||||
? static_cast<PaintedLayerComposite*>(mLayer.get())
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ class ColorLayerComposite;
|
||||
class ContainerLayerComposite;
|
||||
class ImageLayerComposite;
|
||||
class RefLayerComposite;
|
||||
class ThebesLayerComposite;
|
||||
class PaintedLayerComposite;
|
||||
|
||||
class ShadowLayerParent : public PLayerParent
|
||||
{
|
||||
@ -44,7 +44,7 @@ public:
|
||||
ColorLayerComposite* AsColorLayerComposite() const;
|
||||
ImageLayerComposite* AsImageLayerComposite() const;
|
||||
RefLayerComposite* AsRefLayerComposite() const;
|
||||
ThebesLayerComposite* AsThebesLayerComposite() const;
|
||||
PaintedLayerComposite* AsPaintedLayerComposite() const;
|
||||
|
||||
private:
|
||||
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||
|
@ -205,9 +205,9 @@ CreatedLayer(Transaction* aTxn, ShadowableLayer* aLayer)
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::CreatedThebesLayer(ShadowableLayer* aThebes)
|
||||
ShadowLayerForwarder::CreatedPaintedLayer(ShadowableLayer* aThebes)
|
||||
{
|
||||
CreatedLayer<OpCreateThebesLayer>(mTxn, aThebes);
|
||||
CreatedLayer<OpCreatePaintedLayer>(mTxn, aThebes);
|
||||
}
|
||||
void
|
||||
ShadowLayerForwarder::CreatedContainerLayer(ShadowableLayer* aContainer)
|
||||
|
@ -50,7 +50,7 @@ class ShadowableLayer;
|
||||
class ShmemTextureClient;
|
||||
class SurfaceDescriptor;
|
||||
class TextureClient;
|
||||
class ThebesLayerComposite;
|
||||
class PaintedLayerComposite;
|
||||
class ThebesBuffer;
|
||||
class ThebesBufferData;
|
||||
class TiledLayerComposer;
|
||||
@ -189,7 +189,7 @@ public:
|
||||
* created, and a corresponding shadow layer should be created in
|
||||
* the compositing process.
|
||||
*/
|
||||
void CreatedThebesLayer(ShadowableLayer* aThebes);
|
||||
void CreatedPaintedLayer(ShadowableLayer* aThebes);
|
||||
void CreatedContainerLayer(ShadowableLayer* aContainer);
|
||||
void CreatedImageLayer(ShadowableLayer* aImage);
|
||||
void CreatedColorLayer(ShadowableLayer* aColor);
|
||||
|
@ -9,12 +9,12 @@ EXPORTS += [
|
||||
'basic/BasicImplData.h',
|
||||
'basic/BasicLayers.h',
|
||||
'basic/BasicLayersImpl.h',
|
||||
'basic/BasicThebesLayer.h',
|
||||
'basic/BasicPaintedLayer.h',
|
||||
'client/ClientCanvasLayer.h',
|
||||
'client/ClientContainerLayer.h',
|
||||
'client/ClientLayerManager.h',
|
||||
'client/ClientThebesLayer.h',
|
||||
'client/ClientTiledThebesLayer.h',
|
||||
'client/ClientPaintedLayer.h',
|
||||
'client/ClientTiledPaintedLayer.h',
|
||||
'composite/CompositableHost.h',
|
||||
'composite/ImageHost.h',
|
||||
'CopyableCanvasLayer.h',
|
||||
@ -65,8 +65,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
'd3d9/ContainerLayerD3D9.cpp',
|
||||
'd3d9/ImageLayerD3D9.cpp',
|
||||
'd3d9/LayerManagerD3D9.cpp',
|
||||
'd3d9/PaintedLayerD3D9.cpp',
|
||||
'd3d9/TextureD3D9.cpp',
|
||||
'd3d9/ThebesLayerD3D9.cpp',
|
||||
]
|
||||
SOURCES += [
|
||||
'd3d9/CompositorD3D9.cpp',
|
||||
@ -90,8 +90,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
'd3d10/ContainerLayerD3D10.cpp',
|
||||
'd3d10/ImageLayerD3D10.cpp',
|
||||
'd3d10/LayerManagerD3D10.cpp',
|
||||
'd3d10/PaintedLayerD3D10.cpp',
|
||||
'd3d10/ReadbackManagerD3D10.cpp',
|
||||
'd3d10/ThebesLayerD3D10.cpp',
|
||||
'd3d11/TextureD3D11.cpp',
|
||||
'ipc/ShadowLayerUtilsD3D10.cpp',
|
||||
]
|
||||
@ -139,8 +139,8 @@ EXPORTS.mozilla.layers += [
|
||||
'composite/ImageHost.h',
|
||||
'composite/ImageLayerComposite.h',
|
||||
'composite/LayerManagerComposite.h',
|
||||
'composite/PaintedLayerComposite.h',
|
||||
'composite/TextureHost.h',
|
||||
'composite/ThebesLayerComposite.h',
|
||||
'Compositor.h',
|
||||
'CompositorTypes.h',
|
||||
'D3D9SurfaceImage.h',
|
||||
@ -256,7 +256,7 @@ UNIFIED_SOURCES += [
|
||||
'basic/BasicImages.cpp',
|
||||
'basic/BasicLayerManager.cpp',
|
||||
'basic/BasicLayersImpl.cpp',
|
||||
'basic/BasicThebesLayer.cpp',
|
||||
'basic/BasicPaintedLayer.cpp',
|
||||
'basic/TextureHostBasic.cpp',
|
||||
'BufferUnrotate.cpp',
|
||||
'client/CanvasClient.cpp',
|
||||
@ -265,8 +265,8 @@ UNIFIED_SOURCES += [
|
||||
'client/ClientContainerLayer.cpp',
|
||||
'client/ClientImageLayer.cpp',
|
||||
'client/ClientLayerManager.cpp',
|
||||
'client/ClientThebesLayer.cpp',
|
||||
'client/ClientTiledThebesLayer.cpp',
|
||||
'client/ClientPaintedLayer.cpp',
|
||||
'client/ClientTiledPaintedLayer.cpp',
|
||||
'client/CompositableClient.cpp',
|
||||
'client/ContentClient.cpp',
|
||||
'client/ImageClient.cpp',
|
||||
@ -283,9 +283,9 @@ UNIFIED_SOURCES += [
|
||||
'composite/ImageHost.cpp',
|
||||
'composite/ImageLayerComposite.cpp',
|
||||
'composite/LayerManagerComposite.cpp',
|
||||
'composite/PaintedLayerComposite.cpp',
|
||||
'composite/TextRenderer.cpp',
|
||||
'composite/TextureHost.cpp',
|
||||
'composite/ThebesLayerComposite.cpp',
|
||||
'composite/TiledContentHost.cpp',
|
||||
'Compositor.cpp',
|
||||
'CopyableCanvasLayer.cpp',
|
||||
|
@ -121,10 +121,9 @@ GrallocTextureSourceOGL::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter)
|
||||
* texture using fEGLImageTargetTexture2D.
|
||||
*/
|
||||
MOZ_ASSERT(gl());
|
||||
if (!IsValid()) {
|
||||
if (!IsValid() || !gl()->MakeCurrent()) {
|
||||
return;
|
||||
}
|
||||
gl()->MakeCurrent();
|
||||
|
||||
GLuint tex = GetGLTexture();
|
||||
GLuint textureTarget = GetTextureTarget();
|
||||
@ -132,8 +131,8 @@ GrallocTextureSourceOGL::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter)
|
||||
gl()->fActiveTexture(aTextureUnit);
|
||||
gl()->fBindTexture(textureTarget, tex);
|
||||
|
||||
if (mCompositableBackendData) {
|
||||
// There are two paths for locking/unlocking - if mCompositableBackendData is
|
||||
if (mTextureBackendSpecificData) {
|
||||
// There are two paths for locking/unlocking - if mTextureBackendSpecificData is
|
||||
// set, we use the texture on there, otherwise we use
|
||||
// CompositorBackendSpecificData from the compositor and bind the EGLImage
|
||||
// only in Lock().
|
||||
@ -153,29 +152,38 @@ GrallocTextureSourceOGL::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter)
|
||||
#endif
|
||||
}
|
||||
|
||||
void GrallocTextureSourceOGL::Lock()
|
||||
bool GrallocTextureSourceOGL::Lock()
|
||||
{
|
||||
if (mCompositableBackendData) return;
|
||||
if (mTextureBackendSpecificData) {
|
||||
return true;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(IsValid());
|
||||
if (!IsValid()) {
|
||||
return false;
|
||||
}
|
||||
if (!gl()->MakeCurrent()) {
|
||||
NS_WARNING("Failed to make the gl context current");
|
||||
return false;
|
||||
}
|
||||
|
||||
mTexture = mCompositor->GetTemporaryTexture(GetTextureTarget(), LOCAL_GL_TEXTURE0);
|
||||
|
||||
GLuint textureTarget = GetTextureTarget();
|
||||
|
||||
gl()->MakeCurrent();
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
gl()->fBindTexture(textureTarget, mTexture);
|
||||
if (!mEGLImage) {
|
||||
mEGLImage = EGLImageCreateFromNativeBuffer(gl(), mGraphicBuffer->getNativeBuffer());
|
||||
}
|
||||
gl()->fEGLImageTargetTexture2D(textureTarget, mEGLImage);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GrallocTextureSourceOGL::IsValid() const
|
||||
{
|
||||
return !!gl() && !!mGraphicBuffer.get() && (!!mCompositor || !!mCompositableBackendData);
|
||||
return !!gl() && !!mGraphicBuffer.get() && (!!mCompositor || !!mTextureBackendSpecificData);
|
||||
}
|
||||
|
||||
gl::GLContext*
|
||||
@ -218,22 +226,26 @@ GrallocTextureSourceOGL::GetTextureTarget() const
|
||||
}
|
||||
|
||||
void
|
||||
GrallocTextureSourceOGL::SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
GrallocTextureSourceOGL::SetTextureBackendSpecificData(TextureSharedDataGonkOGL* aBackendData)
|
||||
{
|
||||
if (!aBackendData) {
|
||||
DeallocateDeviceData();
|
||||
// Update mCompositableBackendData after calling DeallocateDeviceData().
|
||||
mCompositableBackendData = nullptr;
|
||||
// Update mTextureBackendSpecificData after calling DeallocateDeviceData().
|
||||
mTextureBackendSpecificData = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mCompositableBackendData != aBackendData) {
|
||||
if (mTextureBackendSpecificData != aBackendData) {
|
||||
mNeedsReset = true;
|
||||
}
|
||||
|
||||
if (!gl() || !gl()->MakeCurrent()) {
|
||||
NS_WARNING("Failed to make the context current");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mNeedsReset) {
|
||||
// Update binding to the EGLImage
|
||||
gl()->MakeCurrent();
|
||||
GLuint tex = GetGLTexture();
|
||||
GLuint textureTarget = GetTextureTarget();
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
@ -243,17 +255,16 @@ GrallocTextureSourceOGL::SetCompositableBackendSpecificData(CompositableBackendS
|
||||
}
|
||||
|
||||
if (!mCompositor) {
|
||||
mCompositableBackendData = aBackendData;
|
||||
mTextureBackendSpecificData = aBackendData;
|
||||
return;
|
||||
}
|
||||
|
||||
// delete old EGLImage
|
||||
DeallocateDeviceData();
|
||||
|
||||
// Update mCompositableBackendData after calling DeallocateDeviceData().
|
||||
mCompositableBackendData = aBackendData;
|
||||
// Update mTextureBackendSpecificData after calling DeallocateDeviceData().
|
||||
mTextureBackendSpecificData = aBackendData;
|
||||
|
||||
gl()->MakeCurrent();
|
||||
GLuint tex = GetGLTexture();
|
||||
GLuint textureTarget = GetTextureTarget();
|
||||
|
||||
@ -285,10 +296,11 @@ GrallocTextureSourceOGL::DeallocateDeviceData()
|
||||
{
|
||||
if (mEGLImage) {
|
||||
MOZ_ASSERT(gl());
|
||||
gl()->MakeCurrent();
|
||||
if (mCompositableBackendData) {
|
||||
CompositableDataGonkOGL* backend = static_cast<CompositableDataGonkOGL*>(mCompositableBackendData.get());
|
||||
backend->ClearBoundEGLImage(mEGLImage);
|
||||
if (!gl() || !gl()->MakeCurrent()) {
|
||||
return;
|
||||
}
|
||||
if (mTextureBackendSpecificData) {
|
||||
mTextureBackendSpecificData->ClearBoundEGLImage(mEGLImage);
|
||||
}
|
||||
EGLImageDestroy(gl(), mEGLImage);
|
||||
mEGLImage = EGL_NO_IMAGE;
|
||||
@ -433,10 +445,9 @@ GrallocTextureHostOGL::GetAsSurface() {
|
||||
|
||||
TemporaryRef<gfx::DataSourceSurface>
|
||||
GrallocTextureSourceOGL::GetAsSurface() {
|
||||
if (!IsValid()) {
|
||||
if (!IsValid() || !gl()->MakeCurrent()) {
|
||||
return nullptr;
|
||||
}
|
||||
gl()->MakeCurrent();
|
||||
|
||||
GLuint tex = GetGLTexture();
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
@ -457,9 +468,9 @@ GrallocTextureSourceOGL::GetAsSurface() {
|
||||
GLuint
|
||||
GrallocTextureSourceOGL::GetGLTexture()
|
||||
{
|
||||
if (mCompositableBackendData) {
|
||||
mCompositableBackendData->SetCompositor(mCompositor);
|
||||
return static_cast<CompositableDataGonkOGL*>(mCompositableBackendData.get())->GetTexture();
|
||||
if (mTextureBackendSpecificData) {
|
||||
mTextureBackendSpecificData->SetCompositor(mCompositor);
|
||||
return mTextureBackendSpecificData->GetTexture();
|
||||
}
|
||||
|
||||
return mTexture;
|
||||
@ -468,9 +479,8 @@ GrallocTextureSourceOGL::GetGLTexture()
|
||||
void
|
||||
GrallocTextureSourceOGL::BindEGLImage()
|
||||
{
|
||||
if (mCompositableBackendData) {
|
||||
CompositableDataGonkOGL* backend = static_cast<CompositableDataGonkOGL*>(mCompositableBackendData.get());
|
||||
backend->BindEGLImage(GetTextureTarget(), mEGLImage);
|
||||
if (mTextureBackendSpecificData) {
|
||||
mTextureBackendSpecificData->BindEGLImage(GetTextureTarget(), mEGLImage);
|
||||
} else {
|
||||
gl()->fEGLImageTargetTexture2D(GetTextureTarget(), mEGLImage);
|
||||
}
|
||||
@ -479,9 +489,81 @@ GrallocTextureSourceOGL::BindEGLImage()
|
||||
void
|
||||
GrallocTextureHostOGL::SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
{
|
||||
mCompositableBackendData = aBackendData;
|
||||
if(!aBackendData) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update mTextureBackendSpecificData if it is not set yet.
|
||||
if (!mTextureBackendSpecificData) {
|
||||
MOZ_ASSERT(!mCompositableBackendData);
|
||||
mCompositableBackendData = aBackendData;
|
||||
CompositableDataGonkOGL* backend = static_cast<CompositableDataGonkOGL*>(mCompositableBackendData.get());
|
||||
mTextureBackendSpecificData = backend->GetTextureBackendSpecificData();
|
||||
}
|
||||
|
||||
// If TextureHost sharing by multiple CompositableHosts are detected,
|
||||
// enable mBackendDatas usage.
|
||||
if (!mBackendDatas &&
|
||||
mCompositableBackendData &&
|
||||
mCompositableBackendData != aBackendData &&
|
||||
mTextureBackendSpecificData->IsAllowingSharingTextureHost())
|
||||
{
|
||||
mBackendDatas = MakeUnique<std::map<uint64_t, RefPtr<CompositableBackendSpecificData> > >();
|
||||
(*mBackendDatas)[mCompositableBackendData->GetId()] = mCompositableBackendData;
|
||||
mCompositableBackendData = nullptr;
|
||||
|
||||
// Get new mTextureBackendSpecificData
|
||||
mTextureBackendSpecificData =
|
||||
mTextureBackendSpecificData->GetNewTextureBackendSpecificData(mTextureSource->GetEGLImage());
|
||||
mTextureBackendSpecificData->SetOwnedByTextureHost();
|
||||
}
|
||||
|
||||
// Update mCompositableBackendData.
|
||||
if (mBackendDatas)
|
||||
{
|
||||
// Handle a case that TextureHost has ownership of TextureSharedDataGonkOGL.
|
||||
MOZ_ASSERT(aBackendData->IsAllowingSharingTextureHost());
|
||||
(*mBackendDatas)[aBackendData->GetId()] = aBackendData;
|
||||
if (mBackendDatas->size() > 200) {
|
||||
NS_WARNING("Too many CompositableBackends");
|
||||
}
|
||||
} else {
|
||||
// Handle a case that CompositableHost has ownership of TextureSharedDataGonkOGL.
|
||||
mCompositableBackendData = aBackendData;
|
||||
CompositableDataGonkOGL* backend = static_cast<CompositableDataGonkOGL*>(mCompositableBackendData.get());
|
||||
mTextureBackendSpecificData = backend->GetTextureBackendSpecificData();
|
||||
}
|
||||
|
||||
if (mTextureSource) {
|
||||
mTextureSource->SetCompositableBackendSpecificData(aBackendData);
|
||||
mTextureSource->SetTextureBackendSpecificData(mTextureBackendSpecificData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
GrallocTextureHostOGL::UnsetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
{
|
||||
if(!aBackendData ||
|
||||
!mTextureBackendSpecificData) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mBackendDatas)
|
||||
{
|
||||
// Handle a case that TextureHost has ownership of TextureSharedDataGonkOGL.
|
||||
mBackendDatas->erase(aBackendData->GetId());
|
||||
if (mBackendDatas->size() == 0) {
|
||||
mCompositableBackendData = nullptr;
|
||||
mTextureBackendSpecificData = nullptr;
|
||||
}
|
||||
} else {
|
||||
// Handle a case that CompositableHost has ownership of TextureSharedDataGonkOGL.
|
||||
mCompositableBackendData = nullptr;
|
||||
mTextureBackendSpecificData = nullptr;
|
||||
}
|
||||
|
||||
if (mTextureSource) {
|
||||
mTextureSource->SetTextureBackendSpecificData(mTextureBackendSpecificData);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
return LOCAL_GL_CLAMP_TO_EDGE;
|
||||
}
|
||||
|
||||
virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData) MOZ_OVERRIDE;
|
||||
virtual void SetTextureBackendSpecificData(TextureSharedDataGonkOGL* aBackendData);
|
||||
|
||||
void DeallocateDeviceData();
|
||||
|
||||
@ -66,9 +66,15 @@ public:
|
||||
|
||||
void BindEGLImage();
|
||||
|
||||
void Lock();
|
||||
EGLImage GetEGLImage()
|
||||
{
|
||||
return mEGLImage;
|
||||
}
|
||||
|
||||
bool Lock();
|
||||
|
||||
protected:
|
||||
RefPtr<TextureSharedDataGonkOGL> mTextureBackendSpecificData;
|
||||
CompositorOGL* mCompositor;
|
||||
GrallocTextureHostOGL* mTextureHost;
|
||||
android::sp<android::GraphicBuffer> mGraphicBuffer;
|
||||
@ -126,6 +132,8 @@ public:
|
||||
|
||||
virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData) MOZ_OVERRIDE;
|
||||
|
||||
virtual void UnsetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData) MOZ_OVERRIDE;
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
virtual const char* Name() MOZ_OVERRIDE { return "GrallocTextureHostOGL"; }
|
||||
@ -134,6 +142,9 @@ private:
|
||||
NewSurfaceDescriptorGralloc mGrallocHandle;
|
||||
RefPtr<GrallocTextureSourceOGL> mTextureSource;
|
||||
gfx::IntSize mSize; // See comment in textureClientOGL.h
|
||||
|
||||
RefPtr<TextureSharedDataGonkOGL> mTextureBackendSpecificData;
|
||||
UniquePtr<std::map<uint64_t, RefPtr<CompositableBackendSpecificData> > > mBackendDatas;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
@ -121,47 +121,134 @@ FlagsToGLFlags(TextureFlags aFlags)
|
||||
}
|
||||
|
||||
CompositableDataGonkOGL::CompositableDataGonkOGL()
|
||||
: mTexture(0)
|
||||
{
|
||||
}
|
||||
|
||||
CompositableDataGonkOGL::~CompositableDataGonkOGL()
|
||||
{
|
||||
ClearData();
|
||||
}
|
||||
|
||||
void
|
||||
CompositableDataGonkOGL::ClearData()
|
||||
{
|
||||
CompositableBackendSpecificData::ClearData();
|
||||
mTextureBackendSpecificData = nullptr;
|
||||
mCompositor = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
CompositableDataGonkOGL::SetCompositor(Compositor* aCompositor)
|
||||
{
|
||||
mCompositor = static_cast<CompositorOGL*>(aCompositor);
|
||||
if (mTextureBackendSpecificData) {
|
||||
mTextureBackendSpecificData->SetCompositor(aCompositor);
|
||||
}
|
||||
}
|
||||
|
||||
TextureSharedDataGonkOGL*
|
||||
CompositableDataGonkOGL::GetTextureBackendSpecificData()
|
||||
{
|
||||
if (!mTextureBackendSpecificData) {
|
||||
mTextureBackendSpecificData = new TextureSharedDataGonkOGL();
|
||||
mTextureBackendSpecificData->SetCompositor(mCompositor);
|
||||
mTextureBackendSpecificData->SetAllowSharingTextureHost(IsAllowingSharingTextureHost());
|
||||
}
|
||||
return mTextureBackendSpecificData;
|
||||
}
|
||||
|
||||
TextureSharedDataGonkOGL::TextureSharedDataGonkOGL()
|
||||
: mOwnedByCompositableHost(true)
|
||||
, mAllowSharingTextureHost(false)
|
||||
, mTexture(0)
|
||||
, mBoundEGLImage(EGL_NO_IMAGE)
|
||||
{
|
||||
}
|
||||
CompositableDataGonkOGL::~CompositableDataGonkOGL()
|
||||
|
||||
TextureSharedDataGonkOGL::TextureSharedDataGonkOGL(GLuint aTexture, EGLImage aImage, CompositorOGL* aCompositor)
|
||||
: mOwnedByCompositableHost(true)
|
||||
, mAllowSharingTextureHost(false)
|
||||
, mCompositor(aCompositor)
|
||||
, mTexture(aTexture)
|
||||
, mBoundEGLImage(aImage)
|
||||
{
|
||||
}
|
||||
|
||||
TextureSharedDataGonkOGL::~TextureSharedDataGonkOGL()
|
||||
{
|
||||
DeleteTextureIfPresent();
|
||||
}
|
||||
|
||||
gl::GLContext*
|
||||
CompositableDataGonkOGL::gl() const
|
||||
TextureSharedDataGonkOGL::gl() const
|
||||
{
|
||||
return mCompositor ? mCompositor->gl() : nullptr;
|
||||
}
|
||||
|
||||
void CompositableDataGonkOGL::SetCompositor(Compositor* aCompositor)
|
||||
void
|
||||
TextureSharedDataGonkOGL::SetCompositor(Compositor* aCompositor)
|
||||
{
|
||||
if (gl() && mCompositor != aCompositor) {
|
||||
DeleteTextureIfPresent();
|
||||
}
|
||||
mCompositor = static_cast<CompositorOGL*>(aCompositor);
|
||||
}
|
||||
|
||||
void CompositableDataGonkOGL::ClearData()
|
||||
void
|
||||
TextureSharedDataGonkOGL::ClearData()
|
||||
{
|
||||
CompositableBackendSpecificData::ClearData();
|
||||
DeleteTextureIfPresent();
|
||||
}
|
||||
|
||||
GLuint CompositableDataGonkOGL::GetTexture()
|
||||
TemporaryRef<TextureSharedDataGonkOGL>
|
||||
TextureSharedDataGonkOGL::GetNewTextureBackendSpecificData(EGLImage aImage)
|
||||
{
|
||||
MOZ_ASSERT(IsAllowingSharingTextureHost());
|
||||
|
||||
if (IsEGLImageBound(aImage))
|
||||
{
|
||||
// If EGLImage is already bound to OpenGL Texture,
|
||||
// handover the OpenGL Texture to caller
|
||||
GLuint textureId = GetAndResetGLTextureOwnership();
|
||||
RefPtr<TextureSharedDataGonkOGL> data = new TextureSharedDataGonkOGL(textureId, aImage, mCompositor);
|
||||
data->SetCompositor(mCompositor);
|
||||
data->SetAllowSharingTextureHost(true);
|
||||
return data;
|
||||
}
|
||||
|
||||
// Create brand new TextureSharedDataGonkOGL
|
||||
RefPtr<TextureSharedDataGonkOGL> data = new TextureSharedDataGonkOGL();
|
||||
data->SetCompositor(mCompositor);
|
||||
data->SetAllowSharingTextureHost(true);
|
||||
return data;
|
||||
}
|
||||
|
||||
GLuint
|
||||
TextureSharedDataGonkOGL::GetTexture()
|
||||
{
|
||||
if (!mTexture) {
|
||||
if (gl()->MakeCurrent()) {
|
||||
if (gl() && gl()->MakeCurrent()) {
|
||||
gl()->fGenTextures(1, &mTexture);
|
||||
}
|
||||
}
|
||||
return mTexture;
|
||||
}
|
||||
|
||||
GLuint
|
||||
TextureSharedDataGonkOGL::GetAndResetGLTextureOwnership()
|
||||
{
|
||||
GLuint texture = mTexture;
|
||||
mTexture = 0;
|
||||
mBoundEGLImage = EGL_NO_IMAGE;
|
||||
return texture;
|
||||
}
|
||||
|
||||
void
|
||||
CompositableDataGonkOGL::DeleteTextureIfPresent()
|
||||
TextureSharedDataGonkOGL::DeleteTextureIfPresent()
|
||||
{
|
||||
if (mTexture) {
|
||||
if (gl()->MakeCurrent()) {
|
||||
MOZ_ASSERT(gl());
|
||||
if (gl() && gl()->MakeCurrent()) {
|
||||
gl()->fDeleteTextures(1, &mTexture);
|
||||
}
|
||||
mTexture = 0;
|
||||
@ -170,16 +257,19 @@ CompositableDataGonkOGL::DeleteTextureIfPresent()
|
||||
}
|
||||
|
||||
void
|
||||
CompositableDataGonkOGL::BindEGLImage(GLuint aTarget, EGLImage aImage)
|
||||
TextureSharedDataGonkOGL::BindEGLImage(GLuint aTarget, EGLImage aImage)
|
||||
{
|
||||
if (mBoundEGLImage != aImage) {
|
||||
gl()->fEGLImageTargetTexture2D(aTarget, aImage);
|
||||
MOZ_ASSERT(gl());
|
||||
if (gl()) {
|
||||
gl()->fEGLImageTargetTexture2D(aTarget, aImage);
|
||||
}
|
||||
mBoundEGLImage = aImage;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CompositableDataGonkOGL::ClearBoundEGLImage(EGLImage aImage)
|
||||
TextureSharedDataGonkOGL::ClearBoundEGLImage(EGLImage aImage)
|
||||
{
|
||||
if (mBoundEGLImage == aImage) {
|
||||
DeleteTextureIfPresent();
|
||||
@ -187,6 +277,17 @@ CompositableDataGonkOGL::ClearBoundEGLImage(EGLImage aImage)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
TextureSharedDataGonkOGL::IsEGLImageBound(EGLImage aImage)
|
||||
{
|
||||
if (mTexture != 0 &&
|
||||
aImage != EGL_NO_IMAGE &&
|
||||
aImage == mBoundEGLImage) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
||||
bool
|
||||
TextureHostOGL::SetReleaseFence(const android::sp<android::Fence>& aReleaseFence)
|
||||
|
@ -57,6 +57,7 @@ namespace layers {
|
||||
class Compositor;
|
||||
class CompositorOGL;
|
||||
class TextureImageTextureSourceOGL;
|
||||
class TextureSharedDataGonkOGL;
|
||||
|
||||
/**
|
||||
* CompositableBackendSpecificData implementation for the Gonk OpenGL backend.
|
||||
@ -69,18 +70,83 @@ class TextureImageTextureSourceOGL;
|
||||
*/
|
||||
class CompositableDataGonkOGL : public CompositableBackendSpecificData
|
||||
{
|
||||
public:
|
||||
CompositableDataGonkOGL();
|
||||
protected:
|
||||
virtual ~CompositableDataGonkOGL();
|
||||
|
||||
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
||||
public:
|
||||
CompositableDataGonkOGL();
|
||||
virtual void ClearData() MOZ_OVERRIDE;
|
||||
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
||||
|
||||
TextureSharedDataGonkOGL* GetTextureBackendSpecificData();
|
||||
protected:
|
||||
nsRefPtr<TextureSharedDataGonkOGL> mTextureBackendSpecificData;
|
||||
RefPtr<CompositorOGL> mCompositor;
|
||||
};
|
||||
|
||||
/**
|
||||
* Manage actual shared resources of CompositableDataGonkOGL.
|
||||
* The resources are split from CompositableDataGonkOGL to handle two use cases.
|
||||
* Normally TextureHost is used from one CompositableHost at the same time.
|
||||
* In this case, performance is good if the resources are owned by CompositableDataGonkOGL.
|
||||
* But TextureHost could be shared among multiple ImageHosts.
|
||||
* If it happens, performance is good if the resource is owned by TextureHost.
|
||||
* The resources ownership is carryed over from CompositableDataGonkOGL to TextureHost.
|
||||
* See Bug 1017351.
|
||||
*/
|
||||
class TextureSharedDataGonkOGL
|
||||
{
|
||||
protected:
|
||||
virtual ~TextureSharedDataGonkOGL();
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(TextureSharedDataGonkOGL)
|
||||
|
||||
TextureSharedDataGonkOGL();
|
||||
TextureSharedDataGonkOGL(GLuint aTexture, EGLImage aImage, CompositorOGL* aCompositor);
|
||||
|
||||
void SetCompositor(Compositor* aCompositor);
|
||||
void ClearData();
|
||||
|
||||
// Mark TextureSharedDataGonkOGL as owned by TextureHost.
|
||||
void SetOwnedByTextureHost()
|
||||
{
|
||||
mOwnedByCompositableHost = false;
|
||||
}
|
||||
|
||||
// Check if this is owned by CompositableHost or TextureHost.
|
||||
bool IsOwnedByCompositableHost()
|
||||
{
|
||||
return mOwnedByCompositableHost;
|
||||
}
|
||||
|
||||
bool IsAllowingSharingTextureHost()
|
||||
{
|
||||
return mAllowSharingTextureHost;
|
||||
}
|
||||
|
||||
void SetAllowSharingTextureHost(bool aAllow)
|
||||
{
|
||||
mAllowSharingTextureHost = aAllow;
|
||||
}
|
||||
|
||||
// Create new TextureSharedDataGonkOGL.
|
||||
// If aImage is already bound to OpenGL texture, the OpenGL textre is carried over
|
||||
// to a new object. It could reduce calling fEGLImageTargetTexture2D()
|
||||
// during resources ownership carry over from CompositableHost to TextureHost.
|
||||
TemporaryRef<TextureSharedDataGonkOGL> GetNewTextureBackendSpecificData(EGLImage aImage);
|
||||
|
||||
GLuint GetTexture();
|
||||
void DeleteTextureIfPresent();
|
||||
gl::GLContext* gl() const;
|
||||
void BindEGLImage(GLuint aTarget, EGLImage aImage);
|
||||
void ClearBoundEGLImage(EGLImage aImage);
|
||||
bool IsEGLImageBound(EGLImage aImage);
|
||||
protected:
|
||||
GLuint GetAndResetGLTextureOwnership();
|
||||
|
||||
bool mOwnedByCompositableHost;
|
||||
bool mAllowSharingTextureHost;
|
||||
RefPtr<CompositorOGL> mCompositor;
|
||||
GLuint mTexture;
|
||||
EGLImage mBoundEGLImage;
|
||||
|
@ -963,7 +963,7 @@ bool LayersPacket_Layer_LayerType_IsValid(int value) {
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::UnknownLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::LayerManager;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ContainerLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ThebesLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::PaintedLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::CanvasLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ImageLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ColorLayer;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user