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

Side by Side Diff: Source/WebCore/html/HTMLCanvasElement.cpp

Issue 9340004: Merge 104501 - [chromium win] Creating lots of temporary canvas contexts will crash. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 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/ImageBuffer.h » ('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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 return; 451 return;
452 #if USE(SKIA) 452 #if USE(SKIA)
453 if (deviceSize.width() > MaxSkiaDim || deviceSize.height() > MaxSkiaDim) 453 if (deviceSize.width() > MaxSkiaDim || deviceSize.height() > MaxSkiaDim)
454 return; 454 return;
455 #endif 455 #endif
456 456
457 IntSize bufferSize(deviceSize.width(), deviceSize.height()); 457 IntSize bufferSize(deviceSize.width(), deviceSize.height());
458 if (!bufferSize.width() || !bufferSize.height()) 458 if (!bufferSize.width() || !bufferSize.height())
459 return; 459 return;
460 460
461 RenderingMode renderingMode = shouldAccelerate(bufferSize) ? Accelerated : U naccelerated; 461 RenderingMode renderingMode = shouldAccelerate(bufferSize) ? Accelerated :
462 #if USE(SKIA)
463 UnacceleratedNonPlatformBuffer;
464 #else
465 Unaccelerated;
466 #endif
462 m_imageBuffer = ImageBuffer::create(bufferSize, ColorSpaceDeviceRGB, renderi ngMode); 467 m_imageBuffer = ImageBuffer::create(bufferSize, ColorSpaceDeviceRGB, renderi ngMode);
463 if (!m_imageBuffer) 468 if (!m_imageBuffer)
464 return; 469 return;
465 m_imageBuffer->context()->scale(FloatSize(bufferSize.width() / logicalSize.w idth(), bufferSize.height() / logicalSize.height())); 470 m_imageBuffer->context()->scale(FloatSize(bufferSize.width() / logicalSize.w idth(), bufferSize.height() / logicalSize.height()));
466 m_imageBuffer->context()->setShadowsIgnoreTransforms(true); 471 m_imageBuffer->context()->setShadowsIgnoreTransforms(true);
467 m_imageBuffer->context()->setImageInterpolationQuality(DefaultInterpolationQ uality); 472 m_imageBuffer->context()->setImageInterpolationQuality(DefaultInterpolationQ uality);
468 m_imageBuffer->context()->setStrokeThickness(1); 473 m_imageBuffer->context()->setStrokeThickness(1);
469 474
470 #if USE(JSC) 475 #if USE(JSC)
471 JSC::JSLock lock(JSC::SilenceAssertionsOnly); 476 JSC::JSLock lock(JSC::SilenceAssertionsOnly);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 FloatSize unscaledSize(width(), height()); 525 FloatSize unscaledSize(width(), height());
521 FloatSize deviceSize = convertLogicalToDevice(unscaledSize); 526 FloatSize deviceSize = convertLogicalToDevice(unscaledSize);
522 IntSize size(deviceSize.width(), deviceSize.height()); 527 IntSize size(deviceSize.width(), deviceSize.height());
523 AffineTransform transform; 528 AffineTransform transform;
524 if (size.width() && size.height()) 529 if (size.width() && size.height())
525 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height()); 530 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height());
526 return m_imageBuffer->baseTransform() * transform; 531 return m_imageBuffer->baseTransform() * transform;
527 } 532 }
528 533
529 } 534 }
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/platform/graphics/ImageBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698