Bug 741988 - Avoid potentially triggering an extra draw. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2012-04-05 17:41:11 -04:00
parent 53b68f300e
commit 7d9f0ae32b

View File

@ -1470,6 +1470,7 @@ function Tab(aURL, aParams) {
this.showProgress = true;
this.create(aURL, aParams);
this._zoom = 1.0;
this._drawZoom = 1.0;
this.userScrollPos = { x: 0, y: 0 };
this.contentDocumentIsDisplayed = true;
this.clickToPlayPluginDoorhangerShown = false;
@ -1637,10 +1638,14 @@ Tab.prototype = {
// visible zoom. for foreground tabs, however, if we are drawing at some other
// resolution, we need to set the resolution as specified.
let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
if (BrowserApp.selectedTab == this)
cwu.setResolution(resolution, resolution);
else if (resolution != zoom)
if (BrowserApp.selectedTab == this) {
if (resolution != this._drawZoom) {
this._drawZoom = resolution;
cwu.setResolution(resolution, resolution);
}
} else if (resolution != zoom) {
dump("Warning: setDisplayPort resolution did not match zoom for background tab!");
}
// finally, we set the display port, taking care to convert everything into the CSS-pixel
// coordinate space, because that is what the function accepts.
@ -1671,6 +1676,7 @@ Tab.prototype = {
this._zoom = aZoom;
if (BrowserApp.selectedTab == this) {
let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
this._drawZoom = aZoom;
cwu.setResolution(aZoom, aZoom);
}
}