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

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

Issue 1447273003: Make the FloatSize constructor from an IntSize explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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) 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal); 245 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
246 246
247 GraphicsContextStateSaver stateSaver(*paintInfo.context); 247 GraphicsContextStateSaver stateSaver(*paintInfo.context);
248 248
249 if (!layoutProgress.styleRef().isLeftToRightDirection()) { 249 if (!layoutProgress.styleRef().isLeftToRightDirection()) {
250 paintInfo.context->translate(2 * inflatedRect.x() + inflatedRect.width() , 0); 250 paintInfo.context->translate(2 * inflatedRect.x() + inflatedRect.width() , 0);
251 paintInfo.context->scale(-1, 1); 251 paintInfo.context->scale(-1, 1);
252 } 252 }
253 253
254 if (!paintInfo.context->contextDisabled()) 254 if (!paintInfo.context->contextDisabled())
255 imageBuffer->draw(paintInfo.context, FloatRect(inflatedRect.location(), imageBuffer->size()), nullptr, SkXfermode::kSrcOver_Mode); 255 imageBuffer->draw(paintInfo.context, FloatRect(inflatedRect.location(), FloatSize(imageBuffer->size())), nullptr, SkXfermode::kSrcOver_Mode);
256 return false; 256 return false;
257 } 257 }
258 258
259 bool ThemePainterMac::paintMenuListButton(const LayoutObject& o, const PaintInfo & paintInfo, const IntRect& r) 259 bool ThemePainterMac::paintMenuListButton(const LayoutObject& o, const PaintInfo & paintInfo, const IntRect& r)
260 { 260 {
261 IntRect bounds = IntRect(r.x() + o.styleRef().borderLeftWidth(), 261 IntRect bounds = IntRect(r.x() + o.styleRef().borderLeftWidth(),
262 r.y() + o.styleRef().borderTopWidth(), 262 r.y() + o.styleRef().borderTopWidth(),
263 r.width() - o.styleRef().borderLeftWidth() - o.styl eRef().borderRightWidth(), 263 r.width() - o.styleRef().borderLeftWidth() - o.styl eRef().borderRightWidth(),
264 r.height() - o.styleRef().borderTopWidth() - o.styl eRef().borderBottomWidth()); 264 r.height() - o.styleRef().borderTopWidth() - o.styl eRef().borderBottomWidth());
265 // Since we actually know the size of the control here, we restrict the font 265 // Since we actually know the size of the control here, we restrict the font
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 borderGradientBottomColor = borderGradientBottomColor.blend(tintColor); 334 borderGradientBottomColor = borderGradientBottomColor.blend(tintColor);
335 shadowColor = shadowColor.blend(tintColor); 335 shadowColor = shadowColor.blend(tintColor);
336 } 336 }
337 337
338 Color tintColor; 338 Color tintColor;
339 if (!LayoutTheme::isEnabled(o)) 339 if (!LayoutTheme::isEnabled(o))
340 tintColor = Color(255, 255, 255, 128); 340 tintColor = Color(255, 255, 255, 128);
341 341
342 bool isVerticalSlider = o.styleRef().appearance() == SliderVerticalPart; 342 bool isVerticalSlider = o.styleRef().appearance() == SliderVerticalPart;
343 343
344 int fillRadiusSize = (LayoutThemeMac::sliderTrackWidth - LayoutThemeMac::sli derTrackBorderWidth) / 2; 344 float fillRadiusSize = (LayoutThemeMac::sliderTrackWidth - LayoutThemeMac::s liderTrackBorderWidth) / 2;
345 IntSize fillRadius(fillRadiusSize, fillRadiusSize); 345 FloatSize fillRadius(fillRadiusSize, fillRadiusSize);
346 IntRect fillBounds = enclosedIntRect(unzoomedRect); 346 FloatRect fillBounds(enclosedIntRect(unzoomedRect));
347 FloatRoundedRect fillRect(fillBounds, fillRadius, fillRadius, fillRadius, fi llRadius); 347 FloatRoundedRect fillRect(fillBounds, fillRadius, fillRadius, fillRadius, fi llRadius);
348 paintInfo.context->fillRoundedRect(fillRect, fillColor); 348 paintInfo.context->fillRoundedRect(fillRect, fillColor);
349 349
350 FloatSize shadowOffset(isVerticalSlider ? 1 : 0, 350 FloatSize shadowOffset(isVerticalSlider ? 1 : 0,
351 isVerticalSlider ? 0 : 1); 351 isVerticalSlider ? 0 : 1);
352 float shadowBlur = 3; 352 float shadowBlur = 3;
353 float shadowSpread = 0; 353 float shadowSpread = 0;
354 paintInfo.context->save(); 354 paintInfo.context->save();
355 paintInfo.context->drawInnerShadow(fillRect, shadowColor, shadowOffset, shad owBlur, shadowSpread); 355 paintInfo.context->drawInnerShadow(fillRect, shadowColor, shadowOffset, shad owBlur, shadowSpread);
356 paintInfo.context->restore(); 356 paintInfo.context->restore();
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 [search setSearchMenuTemplate:nil]; 587 [search setSearchMenuTemplate:nil];
588 588
589 m_layoutTheme.updateActiveState([search searchButtonCell], o); 589 m_layoutTheme.updateActiveState([search searchButtonCell], o);
590 590
591 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:m_layoutTheme.d ocumentViewFor(o)]; 591 [[search searchButtonCell] drawWithFrame:unzoomedRect inView:m_layoutTheme.d ocumentViewFor(o)];
592 [[search searchButtonCell] setControlView:nil]; 592 [[search searchButtonCell] setControlView:nil];
593 return false; 593 return false;
594 } 594 }
595 595
596 } // namespace blink 596 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698