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

Side by Side Diff: Source/platform/graphics/filters/FEComposite.cpp

Issue 365163002: Use correct destination rectangle in FEComposite w/ type='in' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Attempt to Mac-proof TC. Created 6 years, 5 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 | « LayoutTests/css3/filters/fecomposite-non-zero-inoffset-expected.html ('k') | no next file » | 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) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(i n2->absolutePaintRect())); 324 filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(i n2->absolutePaintRect()));
325 filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in ->absolutePaintRect())); 325 filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in ->absolutePaintRect()));
326 break; 326 break;
327 case FECOMPOSITE_OPERATOR_IN: { 327 case FECOMPOSITE_OPERATOR_IN: {
328 // Applies only to the intersected region. 328 // Applies only to the intersected region.
329 IntRect destinationRect = in->absolutePaintRect(); 329 IntRect destinationRect = in->absolutePaintRect();
330 destinationRect.intersect(in2->absolutePaintRect()); 330 destinationRect.intersect(in2->absolutePaintRect());
331 destinationRect.intersect(absolutePaintRect()); 331 destinationRect.intersect(absolutePaintRect());
332 if (destinationRect.isEmpty()) 332 if (destinationRect.isEmpty())
333 break; 333 break;
334 IntPoint destinationPoint(destinationRect.x() - absolutePaintRect().x(), destinationRect.y() - absolutePaintRect().y());
335 FloatRect sourceRect(IntPoint(destinationRect.x() - in->absolutePaintRec t().x(), 334 FloatRect sourceRect(IntPoint(destinationRect.x() - in->absolutePaintRec t().x(),
336 destinationRect.y() - in->absolutePaintRect( ).y()), destinationRect.size()); 335 destinationRect.y() - in->absolutePaintRect( ).y()), destinationRect.size());
337 FloatRect source2Rect(IntPoint(destinationRect.x() - in2->absolutePaintR ect().x(), 336 FloatRect source2Rect(IntPoint(destinationRect.x() - in2->absolutePaintR ect().x(),
338 destinationRect.y() - in2->absolutePaintRec t().y()), destinationRect.size()); 337 destinationRect.y() - in2->absolutePaintRec t().y()), destinationRect.size());
339 filterContext->drawImageBuffer(imageBuffer2, 338 destinationRect.move(-absolutePaintRect().x(), -absolutePaintRect().y()) ;
340 FloatRect(destinationPoint, imageBuffer2->size()), &source2Rect); 339 filterContext->drawImageBuffer(imageBuffer2, destinationRect, &source2Re ct);
341 filterContext->drawImageBuffer(imageBuffer, 340 filterContext->drawImageBuffer(imageBuffer, destinationRect, &sourceRect , CompositeSourceIn);
342 FloatRect(destinationPoint, imageBuffer->size()), &sourceRect, Compo siteSourceIn);
343 break; 341 break;
344 } 342 }
345 case FECOMPOSITE_OPERATOR_OUT: 343 case FECOMPOSITE_OPERATOR_OUT:
346 filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in ->absolutePaintRect())); 344 filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in ->absolutePaintRect()));
347 filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(i n2->absolutePaintRect()), 0, CompositeDestinationOut); 345 filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(i n2->absolutePaintRect()), 0, CompositeDestinationOut);
348 break; 346 break;
349 case FECOMPOSITE_OPERATOR_ATOP: 347 case FECOMPOSITE_OPERATOR_ATOP:
350 filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(i n2->absolutePaintRect())); 348 filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(i n2->absolutePaintRect()));
351 filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in ->absolutePaintRect()), 0, CompositeSourceAtop); 349 filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in ->absolutePaintRect()), 0, CompositeSourceAtop);
352 break; 350 break;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 ts << " operation=\"" << m_type << "\""; 435 ts << " operation=\"" << m_type << "\"";
438 if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) 436 if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
439 ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\ " k4=\"" << m_k4 << "\""; 437 ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\ " k4=\"" << m_k4 << "\"";
440 ts << "]\n"; 438 ts << "]\n";
441 inputEffect(0)->externalRepresentation(ts, indent + 1); 439 inputEffect(0)->externalRepresentation(ts, indent + 1);
442 inputEffect(1)->externalRepresentation(ts, indent + 1); 440 inputEffect(1)->externalRepresentation(ts, indent + 1);
443 return ts; 441 return ts;
444 } 442 }
445 443
446 } // namespace WebCore 444 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/css3/filters/fecomposite-non-zero-inoffset-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698