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

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

Issue 54803002: Centralize TextStream functions to remove RenderTreeAsText dependency of the filters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
3 * (C) 2005 Rob Buis <buis@kde.org> 3 * (C) 2005 Rob Buis <buis@kde.org>
4 * (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * (C) 2006 Alexander Kellett <lypanov@kde.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 writeNameValuePair(ts, name, value); 117 writeNameValuePair(ts, name, value);
118 } 118 }
119 119
120 template<typename ValueType> 120 template<typename ValueType>
121 static void writeIfNotDefault(TextStream& ts, const char* name, ValueType value, ValueType defaultValue) 121 static void writeIfNotDefault(TextStream& ts, const char* name, ValueType value, ValueType defaultValue)
122 { 122 {
123 if (value != defaultValue) 123 if (value != defaultValue)
124 writeNameValuePair(ts, name, value); 124 writeNameValuePair(ts, name, value);
125 } 125 }
126 126
127 TextStream& operator<<(TextStream& ts, const FloatRect& r)
128 {
129 ts << "at (" << TextStream::FormatNumberRespectingIntegers(r.x());
130 ts << "," << TextStream::FormatNumberRespectingIntegers(r.y());
131 ts << ") size " << TextStream::FormatNumberRespectingIntegers(r.width());
132 ts << "x" << TextStream::FormatNumberRespectingIntegers(r.height());
133 return ts;
134 }
135
136 TextStream& operator<<(TextStream& ts, const AffineTransform& transform) 127 TextStream& operator<<(TextStream& ts, const AffineTransform& transform)
137 { 128 {
138 if (transform.isIdentity()) 129 if (transform.isIdentity())
139 ts << "identity"; 130 ts << "identity";
140 else 131 else
141 ts << "{m=((" 132 ts << "{m=(("
142 << transform.a() << "," << transform.b() 133 << transform.a() << "," << transform.b()
143 << ")(" 134 << ")("
144 << transform.c() << "," << transform.d() 135 << transform.c() << "," << transform.d()
145 << ")) t=(" 136 << ")) t=("
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 ts << " "; 651 ts << " ";
661 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource()); 652 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
662 ts << " "; 653 ts << " ";
663 writeStandardPrefix(ts, *filter, 0); 654 writeStandardPrefix(ts, *filter, 0);
664 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 655 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
665 } 656 }
666 } 657 }
667 } 658 }
668 659
669 } // namespace WebCore 660 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderTreeAsText.h ('k') | Source/core/svg/graphics/filters/SVGFEImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698