OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. | 2 * Copyright (C) 2009 Apple Inc. |
3 * Copyright (C) 2009 Google Inc. | 3 * Copyright (C) 2009 Google Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // Calculate white-grey gradient. | 246 // Calculate white-grey gradient. |
247 FloatPoint sliderTopLeft = highlightRect.location(); | 247 FloatPoint sliderTopLeft = highlightRect.location(); |
248 FloatPoint sliderBottomLeft = sliderTopLeft; | 248 FloatPoint sliderBottomLeft = sliderTopLeft; |
249 sliderBottomLeft.move(0, highlightRect.height()); | 249 sliderBottomLeft.move(0, highlightRect.height()); |
250 RefPtr<Gradient> gradient = Gradient::create(sliderTopLeft, sliderBottomLeft); | 250 RefPtr<Gradient> gradient = Gradient::create(sliderTopLeft, sliderBottomLeft); |
251 gradient->addColorStop(0.0, startColor); | 251 gradient->addColorStop(0.0, startColor); |
252 gradient->addColorStop(1.0, endColor); | 252 gradient->addColorStop(1.0, endColor); |
253 | 253 |
254 // Fill highlight rectangle with gradient, potentially rounded if on left or | 254 // Fill highlight rectangle with gradient, potentially rounded if on left or |
255 // right edge. | 255 // right edge. |
256 SkPaint gradientPaint(context.fillPaint()); | 256 PaintFlags gradientPaint(context.fillPaint()); |
257 gradient->applyToPaint(gradientPaint, SkMatrix::I()); | 257 gradient->applyToPaint(gradientPaint, SkMatrix::I()); |
258 | 258 |
259 if (startOffset < borderRadius && endOffset < borderRadius) | 259 if (startOffset < borderRadius && endOffset < borderRadius) |
260 context.drawRRect( | 260 context.drawRRect( |
261 FloatRoundedRect(highlightRect, radii, radii, radii, radii), | 261 FloatRoundedRect(highlightRect, radii, radii, radii, radii), |
262 gradientPaint); | 262 gradientPaint); |
263 else if (startOffset < borderRadius) | 263 else if (startOffset < borderRadius) |
264 context.drawRRect(FloatRoundedRect(highlightRect, radii, FloatSize(0, 0), | 264 context.drawRRect(FloatRoundedRect(highlightRect, radii, FloatSize(0, 0), |
265 radii, FloatSize(0, 0)), | 265 radii, FloatSize(0, 0)), |
266 gradientPaint); | 266 gradientPaint); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 void MediaControlsPainter::adjustMediaSliderThumbSize(ComputedStyle& style) { | 595 void MediaControlsPainter::adjustMediaSliderThumbSize(ComputedStyle& style) { |
596 const float zoomLevel = style.effectiveZoom(); | 596 const float zoomLevel = style.effectiveZoom(); |
597 | 597 |
598 style.setWidth( | 598 style.setWidth( |
599 Length(static_cast<int>(mediaSliderThumbTouchWidth * zoomLevel), Fixed)); | 599 Length(static_cast<int>(mediaSliderThumbTouchWidth * zoomLevel), Fixed)); |
600 style.setHeight( | 600 style.setHeight( |
601 Length(static_cast<int>(mediaSliderThumbTouchHeight * zoomLevel), Fixed)); | 601 Length(static_cast<int>(mediaSliderThumbTouchHeight * zoomLevel), Fixed)); |
602 } | 602 } |
603 | 603 |
604 } // namespace blink | 604 } // namespace blink |
OLD | NEW |