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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Rebasing... Created 4 years, 3 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 22 matching lines...) Expand all
33 : LayoutSVGResourceContainer(node) 33 : LayoutSVGResourceContainer(node)
34 { 34 {
35 } 35 }
36 36
37 LayoutSVGResourceMasker::~LayoutSVGResourceMasker() 37 LayoutSVGResourceMasker::~LayoutSVGResourceMasker()
38 { 38 {
39 } 39 }
40 40
41 void LayoutSVGResourceMasker::removeAllClientsFromCache(bool markForInvalidation ) 41 void LayoutSVGResourceMasker::removeAllClientsFromCache(bool markForInvalidation )
42 { 42 {
43 m_maskContentPicture.clear(); 43 m_maskContentPicture.reset();
44 m_maskContentBoundaries = FloatRect(); 44 m_maskContentBoundaries = FloatRect();
45 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval idation : ParentOnlyInvalidation); 45 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval idation : ParentOnlyInvalidation);
46 } 46 }
47 47
48 void LayoutSVGResourceMasker::removeClientFromCache(LayoutObject* client, bool m arkForInvalidation) 48 void LayoutSVGResourceMasker::removeClientFromCache(LayoutObject* client, bool m arkForInvalidation)
49 { 49 {
50 ASSERT(client); 50 ASSERT(client);
51 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati on : ParentOnlyInvalidation); 51 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati on : ParentOnlyInvalidation);
52 } 52 }
53 53
54 PassRefPtr<const SkPicture> LayoutSVGResourceMasker::createContentPicture(Affine Transform& contentTransformation, const FloatRect& targetBoundingBox, 54 sk_sp<const SkPicture> LayoutSVGResourceMasker::createContentPicture(AffineTrans form& contentTransformation, const FloatRect& targetBoundingBox,
55 GraphicsContext& context) 55 GraphicsContext& context)
56 { 56 {
57 SVGUnitTypes::SVGUnitType contentUnits = toSVGMaskElement(element())->maskCo ntentUnits()->currentValue()->enumValue(); 57 SVGUnitTypes::SVGUnitType contentUnits = toSVGMaskElement(element())->maskCo ntentUnits()->currentValue()->enumValue();
58 if (contentUnits == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { 58 if (contentUnits == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
59 contentTransformation.translate(targetBoundingBox.x(), targetBoundingBox .y()); 59 contentTransformation.translate(targetBoundingBox.x(), targetBoundingBox .y());
60 contentTransformation.scaleNonUniform(targetBoundingBox.width(), targetB oundingBox.height()); 60 contentTransformation.scaleNonUniform(targetBoundingBox.width(), targetB oundingBox.height());
61 } 61 }
62 62
63 if (m_maskContentPicture) 63 if (m_maskContentPicture)
64 return m_maskContentPicture; 64 return m_maskContentPicture;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 125 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
126 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 126 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
127 maskRect = transform.mapRect(maskRect); 127 maskRect = transform.mapRect(maskRect);
128 } 128 }
129 129
130 maskRect.intersect(maskBoundaries); 130 maskRect.intersect(maskBoundaries);
131 return maskRect; 131 return maskRect;
132 } 132 }
133 133
134 } // namespace blink 134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698