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

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

Issue 89283002: Merge two determineFilterPrimitiveSubregion implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix final nit Created 7 years 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
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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // Get the zoom factor to scale the filterSourceRect input 366 // Get the zoom factor to scale the filterSourceRect input
367 const RenderLayerModelObject* renderer = renderLayer->renderer(); 367 const RenderLayerModelObject* renderer = renderLayer->renderer();
368 const RenderStyle* style = renderer ? renderer->style() : 0; 368 const RenderStyle* style = renderer ? renderer->style() : 0;
369 float zoom = style ? style->effectiveZoom() : 1.0f; 369 float zoom = style ? style->effectiveZoom() : 1.0f;
370 370
371 AffineTransform absoluteTransform; 371 AffineTransform absoluteTransform;
372 absoluteTransform.translate(filterBoxRect.x(), filterBoxRect.y()); 372 absoluteTransform.translate(filterBoxRect.x(), filterBoxRect.y());
373 filter->setAbsoluteTransform(absoluteTransform); 373 filter->setAbsoluteTransform(absoluteTransform);
374 filter->setAbsoluteFilterRegion(AffineTransform().scale(zoom).mapRect(filter SourceRect)); 374 filter->setAbsoluteFilterRegion(AffineTransform().scale(zoom).mapRect(filter SourceRect));
375 filter->setFilterRegion(absoluteTransform.inverse().mapRect(filterSourceRect )); 375 filter->setFilterRegion(absoluteTransform.inverse().mapRect(filterSourceRect ));
376 filter->lastEffect()->determineFilterPrimitiveSubregion(); 376 filter->lastEffect()->determineFilterPrimitiveSubregion(MapRectForward);
377 377
378 bool hasUpdatedBackingStore = filter->updateBackingStoreRect(filterSourceRec t); 378 bool hasUpdatedBackingStore = filter->updateBackingStoreRect(filterSourceRec t);
379 if (filter->hasFilterThatMovesPixels()) { 379 if (filter->hasFilterThatMovesPixels()) {
380 if (hasUpdatedBackingStore) 380 if (hasUpdatedBackingStore)
381 m_repaintRect = filterSourceRect; 381 m_repaintRect = filterSourceRect;
382 else { 382 else {
383 m_repaintRect.unite(layerRepaintRect); 383 m_repaintRect.unite(layerRepaintRect);
384 m_repaintRect.intersect(filterSourceRect); 384 m_repaintRect.intersect(filterSourceRect);
385 } 385 }
386 } 386 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 // Get the filtered output and draw it in place. 426 // Get the filtered output and draw it in place.
427 m_savedGraphicsContext->drawImageBuffer(filter->output(), filter->outputRect (), CompositeSourceOver); 427 m_savedGraphicsContext->drawImageBuffer(filter->output(), filter->outputRect (), CompositeSourceOver);
428 428
429 filter->clearIntermediateResults(); 429 filter->clearIntermediateResults();
430 430
431 return m_savedGraphicsContext; 431 return m_savedGraphicsContext;
432 } 432 }
433 433
434 } // namespace WebCore 434 } // namespace WebCore
435 435
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/filters/FilterEffect.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698