| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 context->translate(dstRect.x(), dstRect.y()); | 92 context->translate(dstRect.x(), dstRect.y()); |
| 93 if (dstRect.size() != srcRect.size()) | 93 if (dstRect.size() != srcRect.size()) |
| 94 context->scale(dstRect.width() / srcRect.width(), dstRect.height() / src
Rect.height()); | 94 context->scale(dstRect.width() / srcRect.width(), dstRect.height() / src
Rect.height()); |
| 95 context->translate(-srcRect.x(), -srcRect.y()); | 95 context->translate(-srcRect.x(), -srcRect.y()); |
| 96 | 96 |
| 97 drawCrossfade(context); | 97 drawCrossfade(context); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatR
ect& srcRect, const FloatSize& scale, const FloatPoint& phase, CompositeOperator
compositeOp, const FloatRect& dstRect, blink::WebBlendMode blendMode, const Int
Size& repeatSpacing) | 100 void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatR
ect& srcRect, const FloatSize& scale, const FloatPoint& phase, CompositeOperator
compositeOp, const FloatRect& dstRect, blink::WebBlendMode blendMode, const Int
Size& repeatSpacing) |
| 101 { | 101 { |
| 102 OwnPtr<ImageBuffer> imageBuffer = context->createCompatibleBuffer(m_size); | 102 OwnPtr<ImageBuffer> imageBuffer = context->createRasterBuffer(m_size); |
| 103 if (!imageBuffer) | 103 if (!imageBuffer) |
| 104 return; | 104 return; |
| 105 | 105 |
| 106 // Fill with the cross-faded image. | 106 // Fill with the cross-faded image. |
| 107 GraphicsContext* graphicsContext = imageBuffer->context(); | 107 GraphicsContext* graphicsContext = imageBuffer->context(); |
| 108 drawCrossfade(graphicsContext); | 108 drawCrossfade(graphicsContext); |
| 109 | 109 |
| 110 // Tile the image buffer into the context. | 110 // Tile the image buffer into the context. |
| 111 imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRec
t, blendMode, repeatSpacing); | 111 imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRec
t, blendMode, repeatSpacing); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } | 114 } |
| OLD | NEW |