OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "platform/geometry/Region.h" | 27 #include "platform/geometry/Region.h" |
28 | 28 |
29 #include <stdio.h> | 29 #include <stdio.h> |
30 | 30 |
31 // A region class based on the paper "Scanline Coherent Shape Algebra" | 31 // A region class based on the paper "Scanline Coherent Shape Algebra" |
32 // by Jonathan E. Steinhart from the book "Graphics Gems II". | 32 // by Jonathan E. Steinhart from the book "Graphics Gems II". |
33 // | 33 // |
34 // This implementation uses two vectors instead of linked list, and | 34 // This implementation uses two vectors instead of linked list, and |
35 // also compresses regions when possible. | 35 // also compresses regions when possible. |
36 | 36 |
37 namespace WebCore { | 37 namespace blink { |
38 | 38 |
39 Region::Region() | 39 Region::Region() |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 Region::Region(const IntRect& rect) | 43 Region::Region(const IntRect& rect) |
44 : m_bounds(rect) | 44 : m_bounds(rect) |
45 , m_shape(rect) | 45 , m_shape(rect) |
46 { | 46 { |
47 } | 47 } |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 m_shape.swap(subtractedShape); | 621 m_shape.swap(subtractedShape); |
622 m_bounds = m_shape.bounds(); | 622 m_bounds = m_shape.bounds(); |
623 } | 623 } |
624 | 624 |
625 void Region::translate(const IntSize& offset) | 625 void Region::translate(const IntSize& offset) |
626 { | 626 { |
627 m_bounds.move(offset); | 627 m_bounds.move(offset); |
628 m_shape.translate(offset); | 628 m_shape.translate(offset); |
629 } | 629 } |
630 | 630 |
631 } // namespace WebCore | 631 } // namespace blink |
OLD | NEW |