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

Side by Side Diff: third_party/WebKit/Source/core/paint/ThemePainterMac.mm

Issue 2614883007: Change computed style enums to be prefixed with 'k'. (Closed)
Patch Set: Rebase on ToT. Created 3 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) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 CGPathAddLineToPoint(shape, NULL, 6.25, 14.25); 128 CGPathAddLineToPoint(shape, NULL, 6.25, 14.25);
129 CGPathAddLineToPoint(shape, NULL, 10.75, 14.25); 129 CGPathAddLineToPoint(shape, NULL, 10.75, 14.25);
130 CGPathAddLineToPoint(shape, NULL, 10.75, 12); 130 CGPathAddLineToPoint(shape, NULL, 10.75, 12);
131 131
132 // Scale and translate the shape. 132 // Scale and translate the shape.
133 CGRect cgr = r; 133 CGRect cgr = r;
134 CGFloat maxX = CGRectGetMaxX(cgr); 134 CGFloat maxX = CGRectGetMaxX(cgr);
135 CGFloat minX = CGRectGetMinX(cgr); 135 CGFloat minX = CGRectGetMinX(cgr);
136 CGFloat minY = CGRectGetMinY(cgr); 136 CGFloat minY = CGRectGetMinY(cgr);
137 CGFloat heightScale = r.height() / kSquareSize; 137 CGFloat heightScale = r.height() / kSquareSize;
138 const bool isRTL = o.styleRef().direction() == TextDirection::Rtl; 138 const bool isRTL = o.styleRef().direction() == TextDirection::kRtl;
139 CGAffineTransform transform = 139 CGAffineTransform transform =
140 CGAffineTransformMake(heightScale, 0, // A B 140 CGAffineTransformMake(heightScale, 0, // A B
141 0, heightScale, // C D 141 0, heightScale, // C D
142 isRTL ? minX : maxX - r.height(), minY); // Tx Ty 142 isRTL ? minX : maxX - r.height(), minY); // Tx Ty
143 143
144 CGMutablePathRef paintPath = CGPathCreateMutable(); 144 CGMutablePathRef paintPath = CGPathCreateMutable();
145 CGPathAddPath(paintPath, &transform, shape); 145 CGPathAddPath(paintPath, &transform, shape);
146 CGPathRelease(shape); 146 CGPathRelease(shape);
147 147
148 CGContextSetRGBFillColor(c, 0, 0, 0, 0.4); 148 CGContextSetRGBFillColor(c, 0, 0, 0, 0.4);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 bounds.height() / (LayoutThemeMac::menuListBaseArrowHeight * 2 + 276 bounds.height() / (LayoutThemeMac::menuListBaseArrowHeight * 2 +
277 LayoutThemeMac::menuListBaseSpaceBetweenArrows)); 277 LayoutThemeMac::menuListBaseSpaceBetweenArrows));
278 float centerY = bounds.y() + bounds.height() / 2.0f; 278 float centerY = bounds.y() + bounds.height() / 2.0f;
279 float arrowHeight = LayoutThemeMac::menuListBaseArrowHeight * fontScale; 279 float arrowHeight = LayoutThemeMac::menuListBaseArrowHeight * fontScale;
280 float arrowWidth = LayoutThemeMac::menuListBaseArrowWidth * fontScale; 280 float arrowWidth = LayoutThemeMac::menuListBaseArrowWidth * fontScale;
281 float spaceBetweenArrows = 281 float spaceBetweenArrows =
282 LayoutThemeMac::menuListBaseSpaceBetweenArrows * fontScale; 282 LayoutThemeMac::menuListBaseSpaceBetweenArrows * fontScale;
283 float scaledPaddingEnd = 283 float scaledPaddingEnd =
284 LayoutThemeMac::menuListArrowPaddingEnd * o.styleRef().effectiveZoom(); 284 LayoutThemeMac::menuListArrowPaddingEnd * o.styleRef().effectiveZoom();
285 float leftEdge; 285 float leftEdge;
286 if (o.styleRef().direction() == TextDirection::Ltr) { 286 if (o.styleRef().direction() == TextDirection::kLtr) {
287 leftEdge = bounds.maxX() - scaledPaddingEnd - arrowWidth; 287 leftEdge = bounds.maxX() - scaledPaddingEnd - arrowWidth;
288 } else { 288 } else {
289 leftEdge = bounds.x() + scaledPaddingEnd; 289 leftEdge = bounds.x() + scaledPaddingEnd;
290 } 290 }
291 if (bounds.width() < arrowWidth + scaledPaddingEnd) 291 if (bounds.width() < arrowWidth + scaledPaddingEnd)
292 return false; 292 return false;
293 293
294 Color color = o.styleRef().visitedDependentColor(CSSPropertyColor); 294 Color color = o.styleRef().visitedDependentColor(CSSPropertyColor);
295 SkPaint paint = paintInfo.context.fillPaint(); 295 SkPaint paint = paintInfo.context.fillPaint();
296 paint.setAntiAlias(true); 296 paint.setAntiAlias(true);
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1; 802 backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
803 } 803 }
804 804
805 LocalCurrentGraphicsContext localContext(paintInfo.context, rect); 805 LocalCurrentGraphicsContext localContext(paintInfo.context, rect);
806 HIThemeDrawButton(&backgroundBounds, &drawInfo, localContext.cgContext(), 806 HIThemeDrawButton(&backgroundBounds, &drawInfo, localContext.cgContext(),
807 kHIThemeOrientationNormal, 0); 807 kHIThemeOrientationNormal, 0);
808 return false; 808 return false;
809 } 809 }
810 810
811 } // namespace blink 811 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698