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

Side by Side Diff: Source/WebCore/html/HTMLCanvasElement.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, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r, bool u seLowQualityScale) 275 void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r, bool u seLowQualityScale)
276 { 276 {
277 // Clear the dirty rect 277 // Clear the dirty rect
278 m_dirtyRect = FloatRect(); 278 m_dirtyRect = FloatRect();
279 279
280 if (context->paintingDisabled()) 280 if (context->paintingDisabled())
281 return; 281 return;
282 282
283 if (m_context) { 283 if (m_context) {
284 if (!m_context->paintsIntoCanvasBuffer()) 284 if (!m_context->paintsIntoCanvasBuffer() && !document()->printing())
285 return; 285 return;
286 m_context->paintRenderingResultsToCanvas(); 286 m_context->paintRenderingResultsToCanvas();
287 } 287 }
288 288
289 if (hasCreatedImageBuffer()) { 289 if (hasCreatedImageBuffer()) {
290 ImageBuffer* imageBuffer = buffer(); 290 ImageBuffer* imageBuffer = buffer();
291 if (imageBuffer) { 291 if (imageBuffer) {
292 if (m_presentedImage) 292 if (m_presentedImage)
293 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale); 293 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);
294 else 294 else
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 ASSERT(m_hasCreatedImageBuffer); 497 ASSERT(m_hasCreatedImageBuffer);
498 FloatSize unscaledSize(width(), height()); 498 FloatSize unscaledSize(width(), height());
499 IntSize size = convertLogicalToDevice(unscaledSize); 499 IntSize size = convertLogicalToDevice(unscaledSize);
500 AffineTransform transform; 500 AffineTransform transform;
501 if (size.width() && size.height()) 501 if (size.width() && size.height())
502 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height()); 502 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height());
503 return m_imageBuffer->baseTransform() * transform; 503 return m_imageBuffer->baseTransform() * transform;
504 } 504 }
505 505
506 } 506 }
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698