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

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

Issue 1438043012: Avoid int coercion of box-shadow args (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mac theme update, subpixel test 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 int fillRadiusSize = (LayoutThemeMac::sliderTrackWidth - LayoutThemeMac::sli derTrackBorderWidth) / 2;
345 IntSize fillRadius(fillRadiusSize, fillRadiusSize); 345 IntSize fillRadius(fillRadiusSize, fillRadiusSize);
346 IntRect fillBounds = enclosedIntRect(unzoomedRect); 346 IntRect 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 IntSize shadowOffset(isVerticalSlider ? 1 : 0, 350 FloatSize shadowOffset(isVerticalSlider ? 1 : 0,
351 isVerticalSlider ? 0 : 1); 351 isVerticalSlider ? 0 : 1);
352 int shadowBlur = 3; 352 float shadowBlur = 3;
353 int 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();
357 357
358 RefPtr<Gradient> borderGradient = Gradient::create(fillBounds.minXMinYCorner (), 358 RefPtr<Gradient> borderGradient = Gradient::create(fillBounds.minXMinYCorner (),
359 isVerticalSlider ? fillBounds.maxXMinYCorner() : fillBounds.minXMaxYCorn er()); 359 isVerticalSlider ? fillBounds.maxXMinYCorner() : fillBounds.minXMaxYCorn er());
360 borderGradient->addColorStop(0.0, borderGradientTopColor); 360 borderGradient->addColorStop(0.0, borderGradientTopColor);
361 borderGradient->addColorStop(1.0, borderGradientBottomColor); 361 borderGradient->addColorStop(1.0, borderGradientBottomColor);
362 Path borderPath; 362 Path borderPath;
363 FloatRect borderRect(unzoomedRect); 363 FloatRect borderRect(unzoomedRect);
(...skipping 223 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/BoxPainter.cpp ('k') | third_party/WebKit/Source/platform/graphics/DrawLooperBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698