Hi All,

I'm running some code that's attempting to bitblt some memory to a canvas 
surface via SDL.  The code below shows how i'm rendering the surface then 
copying it up to the canvas with SDL:

if (SDL_MUSTLOCK(m_private->surface)) {
if (SDL_LockSurface(m_private->surface) < 0)
return;
}

IntRect clipRect(0, 0, m_private->screen->w, m_private->screen->h);
Frame* coreFrame = m_private->mainFrame->coreFrame();
if (coreFrame->contentRenderer() && coreFrame->view()) {
coreFrame->view()->updateLayoutAndStyleIfNeededRecursive();
cairo_surface_t *cairosurf = cairo_image_surface_create_for_data (
(unsigned char*)m_private->surface->pixels, CAIRO_FORMAT_ARGB32,
m_private->surface->w, m_private->surface->h, m_private->surface->pitch);

 GraphicsContext context(cairo_create(cairosurf));
if (m_private->transparent)
context.clearRect(clipRect);
coreFrame->view()->paintContents(&context, clipRect);
}

if (SDL_MUSTLOCK(m_private->surface))
SDL_UnlockSurface(m_private->surface);
int result = SDL_BlitSurface(m_private->surface, 0, m_private->screen, 0);
ASSERT_UNUSED(result, !result);
SDL_UpdateRect(m_private->screen, 0, 0, m_private->screen->w, 
m_private->screen->h);

However, when I run it it seems to be fine until it gets to a mystery 
"_SDL_UpperBlit" function that fails to run due to a javascript error that 
drawImage doesn't exist (I assume its because its trying to run on a canvas 
object that doesn't exist).

Any advice? Id Imagine the sdl_upperblit call was inlined somehow (as I 
don't use it).

WebKit Trace: 
../deps/WebKit/Source/WebCore/platform/graphics/GraphicsContext.cpp[106] 
WebCore::GraphicsContext::~GraphicsContext() 
example.html:1243<file:///Tint/webkit.js/Debug/example.html>
WebKit Trace: ../deps/cairo/src/cairo.c[317] void cairo_destroy(cairo_t *) 
example.html:1243 <file:///Tint/webkit.js/Debug/example.html>
exception thrown: TypeError: Object #<Object> has no method 
'drawImage',TypeError: Object #<Object> has no method 'drawImage' at 
_SDL_UpperBlit 
(file:///Tint/webkit.js/Debug/test.js:9460:19<file:///Tint/webkit.js/Debug/test.js>)
 
at __ZN6WebKit7WebView4drawEv 
(file:///Tint/webkit.js/Debug/test.js:14821:9<file:///Tint/webkit.js/Debug/test.js>)
 
at __ZN6WebKit7WebView10invalidateEN7WebCore7IntRectEi (
file:///Tint/webkit.js/Debug/test.js:14942:2<file:///Tint/webkit.js/Debug/test.js>)
 
at 
Array.__ZN7WebCore14ChromeClientJS29invalidateContentsAndRootViewERKNS_7IntRectEb
 
(file:///Tint/webkit.js/Debug/test.js:3023513:2<file:///Tint/webkit.js/Debug/test.js>)
 
at Array.__ZN7WebCore6Chrome29invalidateContentsAndRootViewERKNS_7IntRectEb 
(file:///Tint/webkit.js/Debug/test.js:2307292:32<file:///Tint/webkit.js/Debug/test.js>)
 
at __ZN7WebCore10ScrollView23repaintContentRectangleERKNS_7IntRectEb (
file:///Tint/webkit.js/Debug/test.js:2653822:33<file:///Tint/webkit.js/Debug/test.js>)
 
at __ZN7WebCore9FrameView18doDeferredRepaintsEv (
file:///Tint/webkit.js/Debug/test.js:2366297:6<file:///Tint/webkit.js/Debug/test.js>)
 
at __ZN7WebCore9FrameView19endDeferredRepaintsEv (
file:///Tint/webkit.js/Debug/test.js:2360631:2<file:///Tint/webkit.js/Debug/test.js>)
 
at __ZN7WebCore9FrameView6layoutEb (
file:///Tint/webkit.js/Debug/test.js:2359226:4<file:///Tint/webkit.js/Debug/test.js>)
 
at __ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv (
file:///Tint/webkit.js/Debug/test.js:2370578:3<file:///Tint/webkit.js/Debug/test.js>
) example.html:1243 <file:///Tint/webkit.js/Debug/example.html>
Uncaught TypeError: Object #<Object> has no method 'drawImage' 
test.js:3109549 <file:///Tint/webkit.js/Debug/test.js>
WebKit Trace: ../src/WebCoreSupport/SharedTimer.cpp[17] void 
WebCore::sharedTimerRun(void *) 
example.html:1243<file:///Tint/webkit.js/Debug/example.html>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to