Closed Bug 758432 Opened 12 years ago Closed 12 years ago

Fix SetScaleToSize call for plugins

Categories

(Core Graveyard :: Plug-ins, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla15

People

(Reporter: bas.schouten, Assigned: bas.schouten)

References

Details

Attachments

(1 file)

The current code that calls SetScaleToSize calls !UseAsyncRendering to not call this on OS X for some cases. However that is incorrect, UseAsyncRendering actually pretty much returns true everywhere at the moment and thus SetScaleToSize never gets called. And for NPAPI Async drawing we don't get the right scaling when asynchronous surface changes are made by the plugin.

I don't know this code very well and it's hard to make the right decision, we cannot just always call SetScaleToSize as it's not strictly correct for the CoreAnimation drawing model and it's unsupported for OpenGL layer managers.

The best thing to do for now (as we'll want to fix support for NPAPI async drawing), seems to me to just call SetScaleToSize on windows. And use the container size for determining the size only when using the CoreAnimation drawing model.

I will make sure a follow-up bug is filed to find a more proper (cross-platform) way to address the issue before we start using the Async bitmap model on other platforms.
Attachment #627006 - Flags: review?(roc)
Comment on attachment 627006 [details] [diff] [review]
Fix SetScaleToSize calling

Review of attachment 627006 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/generic/nsObjectFrame.cpp
@@ +1522,4 @@
>      size = container->GetCurrentSize();
> +  } else
> +#endif
> +  size = gfxIntSize(window->width, window->height);

{} around this
Attachment #627006 - Flags: review?(roc) → review+
Seems to me we should just add support for SetScaleToSize to all layer managers and call SetScaleToSize always. Why wouldn't that be OK for the CoreAnimation drawing model?
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #2)
> Seems to me we should just add support for SetScaleToSize to all layer
> managers and call SetScaleToSize always. Why wouldn't that be OK for the
> CoreAnimation drawing model?

From what I understand the scaling behavior of CoreAnimation isn't well defined. (i.e. it would at least change behavior from what it is now)
https://hg.mozilla.org/mozilla-central/rev/d4470d16d227
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
If by 'SetScaleToSize' you mean take the current frame and stretch it to fix the container I don't see anything wrong with that.
Depends on: 794836
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: