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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 void FilterEffectRenderer::prepare() | 319 void FilterEffectRenderer::prepare() |
320 { | 320 { |
321 // At this point the effect chain has been built, and the | 321 // At this point the effect chain has been built, and the |
322 // source image sizes set. We just need to attach the graphic | 322 // source image sizes set. We just need to attach the graphic |
323 // buffer if we have not yet done so. | 323 // buffer if we have not yet done so. |
324 if (!m_graphicsBufferAttached) { | 324 if (!m_graphicsBufferAttached) { |
325 setSourceImage(ImageBuffer::create(IntSize(m_sourceDrawingRegion.width()
, m_sourceDrawingRegion.height()), ColorSpaceDeviceRGB, renderingMode())); | 325 setSourceImage(ImageBuffer::create(IntSize(m_sourceDrawingRegion.width()
, m_sourceDrawingRegion.height()), ColorSpaceDeviceRGB, renderingMode())); |
326 m_graphicsBufferAttached = true; | 326 m_graphicsBufferAttached = true; |
327 } | 327 } |
328 m_sourceGraphic->clearResult(); | 328 m_sourceGraphic->clearResult(); |
329 lastEffect()->clearResult(); | 329 for (size_t i = 0; i < m_effects.size(); ++i) |
| 330 m_effects[i]->clearResult(); |
330 } | 331 } |
331 | 332 |
332 void FilterEffectRenderer::apply() | 333 void FilterEffectRenderer::apply() |
333 { | 334 { |
334 lastEffect()->apply(); | 335 lastEffect()->apply(); |
335 } | 336 } |
336 | 337 |
337 | 338 |
338 GraphicsContext* FilterEffectRendererHelper::beginFilterEffect(RenderLayer* rend
erLayer, GraphicsContext* oldContext, const LayoutRect& filterRect) | 339 GraphicsContext* FilterEffectRendererHelper::beginFilterEffect(RenderLayer* rend
erLayer, GraphicsContext* oldContext, const LayoutRect& filterRect) |
339 { | 340 { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 destRect.move(m_paintOffset.x(), m_paintOffset.y()); | 378 destRect.move(m_paintOffset.x(), m_paintOffset.y()); |
378 | 379 |
379 m_savedGraphicsContext->drawImageBuffer(filter->output(), m_renderLayer->ren
derer()->style()->colorSpace(), destRect, CompositeSourceOver); | 380 m_savedGraphicsContext->drawImageBuffer(filter->output(), m_renderLayer->ren
derer()->style()->colorSpace(), destRect, CompositeSourceOver); |
380 | 381 |
381 return m_savedGraphicsContext; | 382 return m_savedGraphicsContext; |
382 } | 383 } |
383 | 384 |
384 } // namespace WebCore | 385 } // namespace WebCore |
385 | 386 |
386 #endif // ENABLE(CSS_FILTERS) | 387 #endif // ENABLE(CSS_FILTERS) |
OLD | NEW |