OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return LayoutRect(rectForRepaint); | 358 return LayoutRect(rectForRepaint); |
359 } | 359 } |
360 | 360 |
361 bool FilterEffectRendererHelper::prepareFilterEffect(RenderLayer* renderLayer, c
onst LayoutRect& filterBoxRect, const LayoutRect& dirtyRect, const LayoutRect& l
ayerRepaintRect) | 361 bool FilterEffectRendererHelper::prepareFilterEffect(RenderLayer* renderLayer, c
onst LayoutRect& filterBoxRect, const LayoutRect& dirtyRect, const LayoutRect& l
ayerRepaintRect) |
362 { | 362 { |
363 ASSERT(m_haveFilterEffect && renderLayer->filterRenderer()); | 363 ASSERT(m_haveFilterEffect && renderLayer->filterRenderer()); |
364 m_renderLayer = renderLayer; | 364 m_renderLayer = renderLayer; |
365 m_repaintRect = dirtyRect; | 365 m_repaintRect = dirtyRect; |
366 | 366 |
367 FilterEffectRenderer* filter = renderLayer->filterRenderer(); | 367 FilterEffectRenderer* filter = renderLayer->filterRenderer(); |
368 LayoutRect filterSourceRect = filter->computeSourceImageRectForDirtyRect(fil
terBoxRect, dirtyRect); | 368 IntRect filterSourceRect = pixelSnappedIntRect(filter->computeSourceImageRec
tForDirtyRect(filterBoxRect, dirtyRect)); |
369 | 369 |
370 if (filterSourceRect.isEmpty()) { | 370 if (filterSourceRect.isEmpty()) { |
371 // The dirty rect is not in view, just bail out. | 371 // The dirty rect is not in view, just bail out. |
372 m_haveFilterEffect = false; | 372 m_haveFilterEffect = false; |
373 return false; | 373 return false; |
374 } | 374 } |
375 | 375 |
376 // Get the zoom factor to scale the filterSourceRect input | 376 // Get the zoom factor to scale the filterSourceRect input |
377 const RenderLayerModelObject* renderer = renderLayer->renderer(); | 377 const RenderLayerModelObject* renderer = renderLayer->renderer(); |
378 const RenderStyle* style = renderer ? renderer->style() : 0; | 378 const RenderStyle* style = renderer ? renderer->style() : 0; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // Get the filtered output and draw it in place. | 436 // Get the filtered output and draw it in place. |
437 m_savedGraphicsContext->drawImageBuffer(filter->output(), filter->outputRect
(), CompositeSourceOver); | 437 m_savedGraphicsContext->drawImageBuffer(filter->output(), filter->outputRect
(), CompositeSourceOver); |
438 | 438 |
439 filter->clearIntermediateResults(); | 439 filter->clearIntermediateResults(); |
440 | 440 |
441 return m_savedGraphicsContext; | 441 return m_savedGraphicsContext; |
442 } | 442 } |
443 | 443 |
444 } // namespace WebCore | 444 } // namespace WebCore |
445 | 445 |
OLD | NEW |