Bug 1200469 part 2 - Discard cursor image urgently. r?tnikkel
Given that script may change cursor image in a high frequency, and it
is usually small, it is probably better discarding it urgently.
MozReview-Commit-ID: J6tqIODXykg
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3348,24 +3348,21 @@ struct nsCursorImage
bool mHaveHotspot;
float mHotspotX, mHotspotY;
nsCursorImage();
nsCursorImage(const nsCursorImage& aOther);
~nsCursorImage();
nsCursorImage& operator=(const nsCursorImage& aOther);
- /*
- * We hide mImage and force access through the getter and setter so that we
- * can lock the images we use. Cursor images are likely to be small, so we
- * don't care about discarding them. See bug 512260.
- * */
+
void SetImage(imgIRequest *aImage) {
if (mImage) {
mImage->UnlockImage();
+ mImage->RequestDiscard();
}
mImage = aImage;
if (mImage) {
mImage->LockImage();
}
}
imgIRequest* GetImage() const {
return mImage;