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

Side by Side Diff: Source/core/rendering/svg/RenderSVGResourceMasker.cpp

Issue 661053003: Make beginLayer() and CanvasRenderingContext2D use SkXfermode::Mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase to ToT Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi nates(); 80 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi nates();
81 81
82 const SVGRenderStyle& svgStyle = style()->svgStyle(); 82 const SVGRenderStyle& svgStyle = style()->svgStyle();
83 ColorFilter maskLayerFilter = svgStyle.maskType() == MT_LUMINANCE 83 ColorFilter maskLayerFilter = svgStyle.maskType() == MT_LUMINANCE
84 ? ColorFilterLuminanceToAlpha : ColorFilterNone; 84 ? ColorFilterLuminanceToAlpha : ColorFilterNone;
85 ColorFilter maskContentFilter = svgStyle.colorInterpolation() == CI_LINEARRG B 85 ColorFilter maskContentFilter = svgStyle.colorInterpolation() == CI_LINEARRG B
86 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; 86 ? ColorFilterSRGBToLinearRGB : ColorFilterNone;
87 87
88 // Mask layer start. 88 // Mask layer start.
89 context->beginLayer(1, CompositeDestinationIn, &paintInvalidationRect, maskL ayerFilter); 89 context->beginLayer(1, SkXfermode::kDstIn_Mode, &paintInvalidationRect, mask LayerFilter);
90 { 90 {
91 // Draw the mask with color conversion (when needed). 91 // Draw the mask with color conversion (when needed).
92 GraphicsContextStateSaver maskContentSaver(*context); 92 GraphicsContextStateSaver maskContentSaver(*context);
93 context->setColorFilter(maskContentFilter); 93 context->setColorFilter(maskContentFilter);
94 94
95 drawMaskForRenderer(context, object->objectBoundingBox()); 95 drawMaskForRenderer(context, object->objectBoundingBox());
96 } 96 }
97 97
98 // Transfer mask layer -> content layer (DstIn) 98 // Transfer mask layer -> content layer (DstIn)
99 context->endLayer(); 99 context->endLayer();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 177 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
178 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 178 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
179 maskRect = transform.mapRect(maskRect); 179 maskRect = transform.mapRect(maskRect);
180 } 180 }
181 181
182 maskRect.intersect(maskBoundaries); 182 maskRect.intersect(maskBoundaries);
183 return maskRect; 183 return maskRect;
184 } 184 }
185 185
186 } 186 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceFilter.cpp ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698