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

Side by Side Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 947893002: Implement SVG masking with slimming paint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a mask debug print string Created 5 years, 10 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
« no previous file with comments | « Source/core/paint/SVGPaintContext.cpp ('k') | Source/platform/graphics/GraphicsContext.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) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 displayItemList = DisplayItemList::create(); 282 displayItemList = DisplayItemList::create();
283 GraphicsContext recordingContext(nullptr, displayItemList.get()); 283 GraphicsContext recordingContext(nullptr, displayItemList.get());
284 recordingContext.beginRecording(dstRect); 284 recordingContext.beginRecording(dstRect);
285 285
286 { 286 {
287 ClipRecorder clipRecorder(displayItemClient(), &recordingContext, Displa yItem::ClipNodeImage, enclosingIntRect(dstRect)); 287 ClipRecorder clipRecorder(displayItemClient(), &recordingContext, Displa yItem::ClipNodeImage, enclosingIntRect(dstRect));
288 288
289 bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode; 289 bool hasCompositing = compositeOp != SkXfermode::kSrcOver_Mode;
290 OwnPtr<CompositingRecorder> compositingRecorder; 290 OwnPtr<CompositingRecorder> compositingRecorder;
291 if (hasCompositing || opacity < 1) 291 if (hasCompositing || opacity < 1)
292 compositingRecorder = adoptPtr(new CompositingRecorder(&recordingCon text, displayItemClient(), compositeOperatorFromSkia(compositeOp), blendModeFrom Skia(compositeOp), opacity)); 292 compositingRecorder = adoptPtr(new CompositingRecorder(&recordingCon text, displayItemClient(), compositeOp, opacity));
293 293
294 // We can only draw the entire frame, clipped to the rect we want. So co mpute where the top left 294 // We can only draw the entire frame, clipped to the rect we want. So co mpute where the top left
295 // of the image would be if we were drawing without clipping, and transl ate accordingly. 295 // of the image would be if we were drawing without clipping, and transl ate accordingly.
296 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr cRect.height()); 296 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr cRect.height());
297 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect. location().y() * scale.height()); 297 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect. location().y() * scale.height());
298 FloatPoint destOffset = dstRect.location() - topLeftOffset; 298 FloatPoint destOffset = dstRect.location() - topLeftOffset;
299 AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y()); 299 AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y());
300 transform.scale(scale.width(), scale.height()); 300 transform.scale(scale.width(), scale.height());
301 TransformRecorder transformRecorder(recordingContext, displayItemClient( ), transform); 301 TransformRecorder transformRecorder(recordingContext, displayItemClient( ), transform);
302 302
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 460
461 return m_page; 461 return m_page;
462 } 462 }
463 463
464 String SVGImage::filenameExtension() const 464 String SVGImage::filenameExtension() const
465 { 465 {
466 return "svg"; 466 return "svg";
467 } 467 }
468 468
469 } 469 }
OLDNEW
« no previous file with comments | « Source/core/paint/SVGPaintContext.cpp ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698