If there was a nice way to get a PlatformCanvas out of a PlatformGraphicsContext when PLATFORM(CG), that'd be awesome.
Brett, I'm not quite sure how you mean to do that. Do you mean that in the glue code, we should instantiate a byte buffer that we ask the rendered to fill in, then use webkit's GraphicsContext functions to write that buffer to screen? For reference, here's the entry point (plus termporary compilation fix) that's causing us the headaches: void MediaPlayerPrivate::paint(GraphicsContext* p, const IntRect& r) { if (m_data) { #if PLATFORM(SKIA) AsDelegate(m_data)->Paint(p->platformContext()->canvas(), webkit_glue::IntRectToWebRect(r)); #else // TODO(port): Mac builds use PLATFORM(CG) which does not expose a // PlatformCanvas from the PlatformContext. Figure out how to render the // video on a mac. notImplemented(); #endif } } 2 delegations later, this ends up in video_render_impl.cc which finds the current video frame to draw, and then writes it to the passed in PlatformCanvas. -Albert On Tue, May 5, 2009 at 7:57 PM, Amanda Walker <ama...@chromium.org> wrote: > That would be pretty clean--or perhaps wrap it in a PlatformCanvas > instead of a bare PlatformGraphicsContext? I haven't looked at the > media code yet, so I'm not familiar with what it's actually trying to > do. > > --Amanda > > On Tue, May 5, 2009 at 10:08 PM, Brett Wilson <bre...@chromium.org> wrote: > > > > On Wed, May 6, 2009 at 8:40 AM, Andrew Scherkus <scher...@chromium.org> > wrote: > >> WebKit's MediaPlayerPrivate interface is a bit backwards where they pass > in > >> a GraphicsContext: > >> > http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/WebKit/WebCore/platform/graphics/MediaPlayer.h?view=markup > >> We currently forward the MediaPlayerPrivate::paint(GraphicsContext* p, > const > >> IntRect& r) call into Chrome, converting the GraphicsContext to > >> a PlatformContextSkia in the process. We realized today this doesn't > work > >> on Mac since it's actually a CGContext. > >> Without resorting to #ifdefs everywhere, what's the best way to pass > >> a PlatformGraphicsContext back to Chrome? > > > > Can you just pass a pointer to the pixels and the size? I think the > > pixel format should be well-defined on each platform, and it should be > > easy to make a SkBitmap in the Chrome side that uses those pixels > > directly. > > > > Brett > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---