Pregunta

I use Firebreath to create a cross browser plugin to do 3D graphics rendering.

The actual drawing happens in my native code on an offscreen target, and each time flush will call myplugin::onWindowRefresh, which will StretchBlt to the windowless window of plugin, code like below,

FB::PluginWindowlessWin *win = dynamic_cast<FB::PluginWindowlessWin*>(pluginWindow);
dstHdc = win->getHDC();
if(srcDib && dstHdc)
{
  FB::Rect r = win->getWindowPosition();
  int dstWidth = r.right - r.left; 
  int dstHeight = r.bottom - r.top;

  SetStretchBltMode(dstHdc, HALFTONE);
  StretchDIBits(dstHdc, r.left, r.top, dstWidth, dstHeight, 0, 0, srcWidth, srcHeight,
  srcDib->GetBits(), srcDib->GetBitmapInfo(), DIB_RGB_COLORS, SRCCOPY);
}

Everything works well until I try my plugin on win8 in IE10. The issue is

The window position got from windowless window is not window position any more, it behaves like plugin position, which means the destination HDC of windowless plugin is in plugin-space coordinates, but in other case (IE9, chrome, firefox, etc), it is window-space coordinates.

So, is it a problem with IE10 on win8 or firebreath issue? Any help/suggestions are appreciated.

Update: The issue only happens in IE10 on win8. I just installed IE10 on win7, and My plugin works well.

¿Fue útil?

Solución

Turns out the fix for this is to use the bounds in the RefreshEvent instead of getWindowPosition.

FB::Rect r = dynamic_cast<FB::RefreshEvent*>(evt)->bounds;

That will probably fix your issue.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top