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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 2398453002: Rewrap comments to 80 columns in Source/platform/graphics/. (Closed)
Patch Set: Review feedback Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
index 68ae29963add88bc295bd64171a59951d565f37b..ae779c3654f2bef2b851f15e7558ce651fc09da3 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
@@ -72,8 +72,8 @@ GraphicsContext::GraphicsContext(PaintController& paintController,
if (metaData)
m_metaData = *metaData;
- // FIXME: Do some tests to determine how many states are typically used, and allocate
- // several here.
+ // FIXME: Do some tests to determine how many states are typically used, and
+ // allocate several here.
m_paintStateStack.append(GraphicsContextState::create());
m_paintState = m_paintStateStack.last().get();
@@ -210,8 +210,9 @@ SkColorFilter* GraphicsContext::getColorFilter() const {
void GraphicsContext::setColorFilter(ColorFilter colorFilter) {
GraphicsContextState* stateToSet = mutableState();
- // We only support one active color filter at the moment. If (when) this becomes a problem,
- // we should switch to using color filter chains (Skia work in progress).
+ // We only support one active color filter at the moment. If (when) this
+ // becomes a problem, we should switch to using color filter chains (Skia work
+ // in progress).
DCHECK(!stateToSet->getColorFilter());
stateToSet->setColorFilter(WebCoreColorFilterToSkiaColorFilter(colorFilter));
}
@@ -482,7 +483,8 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2) {
if (getStrokeStyle() == DottedStroke || getStrokeStyle() == DashedStroke) {
// Do a rect fill of our endpoints. This ensures we always have the
- // appearance of being a border. We then draw the actual dotted/dashed line.
+ // appearance of being a border. We then draw the actual dotted/dashed
+ // line.
SkRect r1, r2;
r1.set(p1.x(), p1.y(), p1.x() + width, p1.y() + width);
r2.set(p2.x(), p2.y(), p2.x() + width, p2.y() + width);
@@ -1039,9 +1041,10 @@ bool isSimpleDRRect(const FloatRoundedRect& outer,
iRadii.bottomLeft().height()))
return false;
- // We also ignore DRRects with a very thick relative stroke (shapes which are mostly filled by
- // the stroke): Skia's stroke outline can diverge significantly from the outer/inner contours
- // in some edge cases, so we fall back to drawDRRect instead.
+ // We also ignore DRRects with a very thick relative stroke (shapes which are
+ // mostly filled by the stroke): Skia's stroke outline can diverge
+ // significantly from the outer/inner contours in some edge cases, so we fall
+ // back to drawDRRect() instead.
const float kMaxStrokeToSizeRatio = 0.75f;
if (2 * strokeSize.width() / outer.rect().width() > kMaxStrokeToSizeRatio ||
2 * strokeSize.height() / outer.rect().height() > kMaxStrokeToSizeRatio)
@@ -1150,7 +1153,8 @@ void GraphicsContext::clipOut(const Path& pathToClip) {
if (contextDisabled())
return;
- // Use const_cast and temporarily toggle the inverse fill type instead of copying the path.
+ // Use const_cast and temporarily toggle the inverse fill type instead of
+ // copying the path.
SkPath& path = const_cast<SkPath&>(pathToClip.getSkPath());
path.toggleInverseFillType();
clipPath(path, AntiAliased);
@@ -1272,10 +1276,11 @@ void GraphicsContext::adjustLineToPixelBoundaries(FloatPoint& p1,
FloatPoint& p2,
float strokeWidth,
StrokeStyle penStyle) {
- // For odd widths, we add in 0.5 to the appropriate x/y so that the float arithmetic
- // works out. For example, with a border width of 3, WebKit will pass us (y1+y2)/2, e.g.,
- // (50+53)/2 = 103/2 = 51 when we want 51.5. It is always true that an even width gave
- // us a perfect position, but an odd width gave us a position that is off by exactly 0.5.
+ // For odd widths, we add in 0.5 to the appropriate x/y so that the float
+ // arithmetic works out. For example, with a border width of 3, WebKit will
+ // pass us (y1+y2)/2, e.g., (50+53)/2 = 103/2 = 51 when we want 51.5. It is
+ // always true that an even width gave us a perfect position, but an odd width
+ // gave us a position that is off by exactly 0.5.
if (penStyle == DottedStroke || penStyle == DashedStroke) {
if (p1.x() == p2.x()) {
p1.setY(p1.y() + strokeWidth);
@@ -1286,7 +1291,7 @@ void GraphicsContext::adjustLineToPixelBoundaries(FloatPoint& p1,
}
}
- if (static_cast<int>(strokeWidth) % 2) { //odd
+ if (static_cast<int>(strokeWidth) % 2) { // odd
if (p1.x() == p2.x()) {
// We're a vertical line. Adjust our x.
p1.setX(p1.x() + 0.5f);

Powered by Google App Engine
This is Rietveld 408576698