OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |