| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 picturePaint.setImageFilter(SkPictureImageFilter::MakeForLocalSpace( | 322 picturePaint.setImageFilter(SkPictureImageFilter::MakeForLocalSpace( |
| 323 std::move(picture), sourceBounds, | 323 std::move(picture), sourceBounds, |
| 324 static_cast<SkFilterQuality>(imageInterpolationQuality()))); | 324 static_cast<SkFilterQuality>(imageInterpolationQuality()))); |
| 325 m_canvas->saveLayer(&sourceBounds, &picturePaint); | 325 m_canvas->saveLayer(&sourceBounds, &picturePaint); |
| 326 m_canvas->restore(); | 326 m_canvas->restore(); |
| 327 m_canvas->restore(); | 327 m_canvas->restore(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void GraphicsContext::drawFocusRingPath(const SkPath& path, | 330 void GraphicsContext::drawFocusRingPath(const SkPath& path, |
| 331 const Color& color, | 331 const Color& color, |
| 332 int width) { | 332 float width) { |
| 333 drawPlatformFocusRing(path, m_canvas, color.rgb(), width); | 333 drawPlatformFocusRing(path, m_canvas, color.rgb(), width); |
| 334 } | 334 } |
| 335 | 335 |
| 336 void GraphicsContext::drawFocusRingRect(const SkRect& rect, | 336 void GraphicsContext::drawFocusRingRect(const SkRect& rect, |
| 337 const Color& color, | 337 const Color& color, |
| 338 int width) { | 338 float width) { |
| 339 drawPlatformFocusRing(rect, m_canvas, color.rgb(), width); | 339 drawPlatformFocusRing(rect, m_canvas, color.rgb(), width); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void GraphicsContext::drawFocusRing(const Path& focusRingPath, | 342 void GraphicsContext::drawFocusRing(const Path& focusRingPath, |
| 343 int width, | 343 float width, |
| 344 int offset, | 344 int offset, |
| 345 const Color& color) { | 345 const Color& color) { |
| 346 // FIXME: Implement support for offset. | 346 // FIXME: Implement support for offset. |
| 347 if (contextDisabled()) | 347 if (contextDisabled()) |
| 348 return; | 348 return; |
| 349 | 349 |
| 350 drawFocusRingPath(focusRingPath.getSkPath(), color, width); | 350 drawFocusRingPath(focusRingPath.getSkPath(), color, width); |
| 351 } | 351 } |
| 352 | 352 |
| 353 void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, | 353 void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, |
| 354 int width, | 354 float width, |
| 355 int offset, | 355 int offset, |
| 356 const Color& color) { | 356 const Color& color) { |
| 357 if (contextDisabled()) | 357 if (contextDisabled()) |
| 358 return; | 358 return; |
| 359 | 359 |
| 360 unsigned rectCount = rects.size(); | 360 unsigned rectCount = rects.size(); |
| 361 if (!rectCount) | 361 if (!rectCount) |
| 362 return; | 362 return; |
| 363 | 363 |
| 364 SkRegion focusRingRegion; | 364 SkRegion focusRingRegion; |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 static const SkPMColor colors[] = { | 1410 static const SkPMColor colors[] = { |
| 1411 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red | 1411 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red |
| 1412 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray | 1412 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray |
| 1413 }; | 1413 }; |
| 1414 | 1414 |
| 1415 return colors[index]; | 1415 return colors[index]; |
| 1416 } | 1416 } |
| 1417 #endif | 1417 #endif |
| 1418 | 1418 |
| 1419 } // namespace blink | 1419 } // namespace blink |
| OLD | NEW |