| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 static inline int getFocusRingOutset(int offset) { return offset + 2; } | 419 static inline int getFocusRingOutset(int offset) { return offset + 2; } |
| 420 #else | 420 #else |
| 421 static inline int getFocusRingOutset(int offset) { return 0; } | 421 static inline int getFocusRingOutset(int offset) { return 0; } |
| 422 static const SkPMColor lineColors(int); | 422 static const SkPMColor lineColors(int); |
| 423 static const SkPMColor antiColors1(int); | 423 static const SkPMColor antiColors1(int); |
| 424 static const SkPMColor antiColors2(int); | 424 static const SkPMColor antiColors2(int); |
| 425 static void draw1xMarker(SkBitmap*, int); | 425 static void draw1xMarker(SkBitmap*, int); |
| 426 static void draw2xMarker(SkBitmap*, int); | 426 static void draw2xMarker(SkBitmap*, int); |
| 427 #endif | 427 #endif |
| 428 | 428 |
| 429 // Return value % max, but account for value possibly being negative. | |
| 430 static int fastMod(int value, int max) | |
| 431 { | |
| 432 bool isNeg = false; | |
| 433 if (value < 0) { | |
| 434 value = -value; | |
| 435 isNeg = true; | |
| 436 } | |
| 437 if (value >= max) | |
| 438 value %= max; | |
| 439 if (isNeg) | |
| 440 value = -value; | |
| 441 return value; | |
| 442 } | |
| 443 | |
| 444 // Helpers for drawing a focus ring (drawFocusRing) | 429 // Helpers for drawing a focus ring (drawFocusRing) |
| 445 void drawOuterPath(const SkPath&, SkPaint&, int); | 430 void drawOuterPath(const SkPath&, SkPaint&, int); |
| 446 void drawInnerPath(const SkPath&, SkPaint&, int); | 431 void drawInnerPath(const SkPath&, SkPaint&, int); |
| 447 | 432 |
| 448 // SkCanvas wrappers. | 433 // SkCanvas wrappers. |
| 449 bool isDrawingToLayer() const { return m_canvas->isDrawingToLayer(); } | |
| 450 | |
| 451 void clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op
= SkRegion::kIntersect_Op); | 434 void clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op
= SkRegion::kIntersect_Op); |
| 452 void clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion::
Op = SkRegion::kIntersect_Op); | 435 void clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion::
Op = SkRegion::kIntersect_Op); |
| 453 | 436 |
| 454 void concat(const SkMatrix&); | 437 void concat(const SkMatrix&); |
| 455 | 438 |
| 456 // Apply deferred paint state saves | 439 // Apply deferred paint state saves |
| 457 void realizePaintSave() | 440 void realizePaintSave() |
| 458 { | 441 { |
| 459 if (contextDisabled()) | 442 if (contextDisabled()) |
| 460 return; | 443 return; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 bool m_updatingControlTints : 1; | 519 bool m_updatingControlTints : 1; |
| 537 bool m_accelerated : 1; | 520 bool m_accelerated : 1; |
| 538 bool m_isCertainlyOpaque : 1; | 521 bool m_isCertainlyOpaque : 1; |
| 539 bool m_printing : 1; | 522 bool m_printing : 1; |
| 540 bool m_antialiasHairlineImages : 1; | 523 bool m_antialiasHairlineImages : 1; |
| 541 }; | 524 }; |
| 542 | 525 |
| 543 } // namespace WebCore | 526 } // namespace WebCore |
| 544 | 527 |
| 545 #endif // GraphicsContext_h | 528 #endif // GraphicsContext_h |
| OLD | NEW |