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

Side by Side Diff: Source/core/rendering/FilterEffectRenderer.cpp

Issue 20723003: Fix pixel snapping issues when layers become composited (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring up to ToT again... Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/CompositedLayerMapping.cpp ('k') | Source/core/rendering/RenderLayer.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) 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
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
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
OLDNEW
« no previous file with comments | « Source/core/rendering/CompositedLayerMapping.cpp ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698