Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

Issue 7564022: Merge 91870 - Fix for printing with accelerated <canvas> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/html/HTMLCanvasElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
===================================================================
--- Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (revision 92294)
+++ Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (working copy)
@@ -112,8 +112,12 @@
void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
CompositeOperator op, bool useLowQualityScale)
{
+ m_context->platformContext()->makeGrContextCurrent();
+ SkDevice* srcDevice = m_context->platformContext()->canvas()->getDevice();
+ SkBitmap bitmap = srcDevice->accessBitmap(false);
+ SkAutoLockPixels bitmapLock(bitmap);
context->platformContext()->makeGrContextCurrent();
- RefPtr<Image> image = BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), context == m_context);
+ RefPtr<Image> image = BitmapImageSingleFrameSkia::create(bitmap, context == m_context);
context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
}
« no previous file with comments | « Source/WebCore/html/HTMLCanvasElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698