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

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

Issue 2007553002: Retire setGradientSpaceTransform, setPatternSpaceTransform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fmalita discovers SkMatrix::I() Created 4 years, 6 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 borderGradient->addColorStop(0.0, borderGradientTopColor); 352 borderGradient->addColorStop(0.0, borderGradientTopColor);
353 borderGradient->addColorStop(1.0, borderGradientBottomColor); 353 borderGradient->addColorStop(1.0, borderGradientBottomColor);
354 354
355 FloatRect borderRect(unzoomedRect); 355 FloatRect borderRect(unzoomedRect);
356 borderRect.inflate(-LayoutThemeMac::sliderTrackBorderWidth / 2.0); 356 borderRect.inflate(-LayoutThemeMac::sliderTrackBorderWidth / 2.0);
357 float borderRadiusSize = (isVerticalSlider ? borderRect.width() : borderRect .height()) / 2; 357 float borderRadiusSize = (isVerticalSlider ? borderRect.width() : borderRect .height()) / 2;
358 FloatSize borderRadius(borderRadiusSize, borderRadiusSize); 358 FloatSize borderRadius(borderRadiusSize, borderRadiusSize);
359 FloatRoundedRect borderRRect(borderRect, borderRadius, borderRadius, borderR adius, borderRadius); 359 FloatRoundedRect borderRRect(borderRect, borderRadius, borderRadius, borderR adius, borderRadius);
360 paintInfo.context.setStrokeThickness(LayoutThemeMac::sliderTrackBorderWidth) ; 360 paintInfo.context.setStrokeThickness(LayoutThemeMac::sliderTrackBorderWidth) ;
361 SkPaint borderPaint(paintInfo.context.strokePaint()); 361 SkPaint borderPaint(paintInfo.context.strokePaint());
362 borderGradient->applyToPaint(borderPaint); 362 borderGradient->applyToPaint(borderPaint, SkMatrix::I());
363 paintInfo.context.drawRRect(borderRRect, borderPaint); 363 paintInfo.context.drawRRect(borderRRect, borderPaint);
364 364
365 return false; 365 return false;
366 } 366 }
367 367
368 368
369 bool ThemePainterMac::paintSliderThumb(const LayoutObject& o, const PaintInfo& p aintInfo, const IntRect& r) 369 bool ThemePainterMac::paintSliderThumb(const LayoutObject& o, const PaintInfo& p aintInfo, const IntRect& r)
370 { 370 {
371 GraphicsContextStateSaver stateSaver(paintInfo.context); 371 GraphicsContextStateSaver stateSaver(paintInfo.context);
372 float zoomLevel = o.styleRef().effectiveZoom(); 372 float zoomLevel = o.styleRef().effectiveZoom();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 paintInfo.context.fillEllipse(borderBounds); 416 paintInfo.context.fillEllipse(borderBounds);
417 paintInfo.context.setDrawLooper(nullptr); 417 paintInfo.context.setDrawLooper(nullptr);
418 418
419 IntRect fillBounds = enclosedIntRect(unzoomedRect); 419 IntRect fillBounds = enclosedIntRect(unzoomedRect);
420 RefPtr<Gradient> fillGradient = Gradient::create(fillBounds.minXMinYCorner() , fillBounds.minXMaxYCorner()); 420 RefPtr<Gradient> fillGradient = Gradient::create(fillBounds.minXMinYCorner() , fillBounds.minXMaxYCorner());
421 fillGradient->addColorStop(0.0, fillGradientTopColor); 421 fillGradient->addColorStop(0.0, fillGradientTopColor);
422 fillGradient->addColorStop(0.52, fillGradientUpperMiddleColor); 422 fillGradient->addColorStop(0.52, fillGradientUpperMiddleColor);
423 fillGradient->addColorStop(0.52, fillGradientLowerMiddleColor); 423 fillGradient->addColorStop(0.52, fillGradientLowerMiddleColor);
424 fillGradient->addColorStop(1.0, fillGradientBottomColor); 424 fillGradient->addColorStop(1.0, fillGradientBottomColor);
425 SkPaint fillPaint(paintInfo.context.fillPaint()); 425 SkPaint fillPaint(paintInfo.context.fillPaint());
426 fillGradient->applyToPaint(fillPaint); 426 fillGradient->applyToPaint(fillPaint, SkMatrix::I());
427 paintInfo.context.drawOval(borderBounds, fillPaint); 427 paintInfo.context.drawOval(borderBounds, fillPaint);
428 428
429 RefPtr<Gradient> borderGradient = Gradient::create(fillBounds.minXMinYCorner (), fillBounds.minXMaxYCorner()); 429 RefPtr<Gradient> borderGradient = Gradient::create(fillBounds.minXMinYCorner (), fillBounds.minXMaxYCorner());
430 borderGradient->addColorStop(0.0, borderGradientTopColor); 430 borderGradient->addColorStop(0.0, borderGradientTopColor);
431 borderGradient->addColorStop(1.0, borderGradientBottomColor); 431 borderGradient->addColorStop(1.0, borderGradientBottomColor);
432 paintInfo.context.setStrokeThickness(LayoutThemeMac::sliderThumbBorderWidth) ; 432 paintInfo.context.setStrokeThickness(LayoutThemeMac::sliderThumbBorderWidth) ;
433 SkPaint borderPaint(paintInfo.context.strokePaint()); 433 SkPaint borderPaint(paintInfo.context.strokePaint());
434 borderGradient->applyToPaint(borderPaint); 434 borderGradient->applyToPaint(borderPaint, SkMatrix::I());
435 paintInfo.context.drawOval(borderBounds, borderPaint); 435 paintInfo.context.drawOval(borderBounds, borderPaint);
436 436
437 if (LayoutTheme::isFocused(o)) { 437 if (LayoutTheme::isFocused(o)) {
438 Path borderPath; 438 Path borderPath;
439 borderPath.addEllipse(borderBounds); 439 borderPath.addEllipse(borderBounds);
440 paintInfo.context.drawFocusRing(borderPath, 5, -2, m_layoutTheme.focusRi ngColor()); 440 paintInfo.context.drawFocusRing(borderPath, 5, -2, m_layoutTheme.focusRi ngColor());
441 } 441 }
442 442
443 return false; 443 return false;
444 } 444 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 paintInfo.context.rotate(deg2rad(-45.0)); 541 paintInfo.context.rotate(deg2rad(-45.0));
542 paintInfo.context.translate(-centerX, -centerY); 542 paintInfo.context.translate(-centerX, -centerY);
543 543
544 paintInfo.context.setFillColor(fillColor); 544 paintInfo.context.setFillColor(fillColor);
545 paintInfo.context.fillEllipse(unzoomedRect); 545 paintInfo.context.fillEllipse(unzoomedRect);
546 546
547 return false; 547 return false;
548 } 548 }
549 549
550 } // namespace blink 550 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698