diff options
author | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 19:08:31 +0000 |
---|---|---|
committer | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 19:08:31 +0000 |
commit | d36b273f1b250bae1298915b3334b292f12a881c (patch) | |
tree | 01d9ae86c752d72cf5e7256bf28da660a642dce8 /webkit/glue | |
parent | a10cc906886dfd4f68d9ebcdf1611e973354c90b (diff) | |
download | chromium_src-d36b273f1b250bae1298915b3334b292f12a881c.zip chromium_src-d36b273f1b250bae1298915b3334b292f12a881c.tar.gz chromium_src-d36b273f1b250bae1298915b3334b292f12a881c.tar.bz2 |
Implement CaptureImage on the Mac
Review URL: http://codereview.chromium.org/7237
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-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(); } |