Hard to tell from the code fragments, can you please make a full standalone testcase, as small as possible, that shows the issue?
- Alon On Sat, Mar 29, 2014 at 3:41 PM, Trevor Linton <[email protected]>wrote: > 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 > WebKit Trace: ../deps/cairo/src/cairo.c[317] void cairo_destroy(cairo_t *) > example.html:1243 > 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) at > __ZN6WebKit7WebView4drawEv (file:///Tint/webkit.js/Debug/test.js:14821:9) > at __ZN6WebKit7WebView10invalidateEN7WebCore7IntRectEi ( > file:///Tint/webkit.js/Debug/test.js:14942:2) at > Array.__ZN7WebCore14ChromeClientJS29invalidateContentsAndRootViewERKNS_7IntRectEb > (file:///Tint/webkit.js/Debug/test.js:3023513:2) at > Array.__ZN7WebCore6Chrome29invalidateContentsAndRootViewERKNS_7IntRectEb ( > file:///Tint/webkit.js/Debug/test.js:2307292:32) at > __ZN7WebCore10ScrollView23repaintContentRectangleERKNS_7IntRectEb ( > file:///Tint/webkit.js/Debug/test.js:2653822:33) at > __ZN7WebCore9FrameView18doDeferredRepaintsEv ( > file:///Tint/webkit.js/Debug/test.js:2366297:6) at > __ZN7WebCore9FrameView19endDeferredRepaintsEv ( > file:///Tint/webkit.js/Debug/test.js:2360631:2) at > __ZN7WebCore9FrameView6layoutEb ( > file:///Tint/webkit.js/Debug/test.js:2359226:4) at > __ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv ( > file:///Tint/webkit.js/Debug/test.js:2370578:3) example.html:1243 > Uncaught TypeError: Object #<Object> has no method 'drawImage' > test.js:3109549 > WebKit Trace: ../src/WebCoreSupport/SharedTimer.cpp[17] void > WebCore::sharedTimerRun(void *) example.html:1243 > > -- > 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. > -- 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.
