diff options
Diffstat (limited to 'webkit/glue/webframe_impl.cc')
-rw-r--r-- | webkit/glue/webframe_impl.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 1e0e778..fa607d5 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -1508,8 +1508,24 @@ gfx::BitmapPlatformDevice WebFrameImpl::CaptureImage(bool scroll_to_zero) { device.fixupAlphaBeforeCompositing(); return device; } +#elif defined(OS_MACOSX) +gfx::BitmapPlatformDevice WebFrameImpl::CaptureImage(bool scroll_to_zero) { + // Must layout before painting. + Layout(); + + gfx::PlatformCanvasMac canvas(frameview()->width(), + frameview()->height(), true); + CGContextRef context = canvas.beginPlatformPaint(); + GraphicsContext gc(context); + frameview()->paint(&gc, IntRect(0, 0, frameview()->width(), + frameview()->height())); + canvas.endPlatformPaint(); + + gfx::BitmapPlatformDevice& device = + static_cast<gfx::BitmapPlatformDevice&>(canvas.getTopPlatformDevice()); + return device; +} #else -// TODO(pinkerton): waiting on bitmap re-factor from awalker gfx::BitmapPlatformDevice WebFrameImpl::CaptureImage(bool scroll_to_zero) { NOTIMPLEMENTED(); } |