| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 namespace blink { | 27 namespace blink { |
| 28 | 28 |
| 29 class GraphicsContext; | 29 class GraphicsContext; |
| 30 | 30 |
| 31 // This class automatically saves and restores the current NSGraphicsContext for | 31 // This class automatically saves and restores the current NSGraphicsContext for |
| 32 // functions which call out into AppKit and rely on the currentContext being set | 32 // functions which call out into AppKit and rely on the currentContext being set |
| 33 class PLATFORM_EXPORT LocalCurrentGraphicsContext { | 33 class PLATFORM_EXPORT LocalCurrentGraphicsContext { |
| 34 WTF_MAKE_NONCOPYABLE(LocalCurrentGraphicsContext); | 34 WTF_MAKE_NONCOPYABLE(LocalCurrentGraphicsContext); |
| 35 public: | 35 public: |
| 36 LocalCurrentGraphicsContext(GraphicsContext*, IntRect clipRect); | 36 LocalCurrentGraphicsContext(GraphicsContext* graphicsContext); |
| 37 ~LocalCurrentGraphicsContext(); | 37 ~LocalCurrentGraphicsContext(); |
| 38 CGContextRef cgContext(); | 38 CGContextRef cgContext(); |
| 39 private: | 39 private: |
| 40 | |
| 41 GraphicsContext* m_savedGraphicsContext; | 40 GraphicsContext* m_savedGraphicsContext; |
| 42 NSGraphicsContext* m_savedNSGraphicsContext; | 41 NSGraphicsContext* m_savedNSGraphicsContext; |
| 43 bool m_didSetGraphicsContext; | 42 bool m_didSetGraphicsContext; |
| 44 gfx::SkiaBitLocker m_skiaBitLocker; | 43 gfx::SkiaBitLocker m_skiaBitLocker; |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 class PLATFORM_EXPORT ContextContainer { | 46 class PLATFORM_EXPORT ContextContainer { |
| 48 WTF_MAKE_NONCOPYABLE(ContextContainer); | 47 WTF_MAKE_NONCOPYABLE(ContextContainer); |
| 49 public: | 48 public: |
| 50 ContextContainer(GraphicsContext*); | 49 ContextContainer(GraphicsContext*); |
| 51 | 50 |
| 52 // This synchronizes the CGContext to reflect the current SkCanvas state. | 51 // This synchronizes the CGContext to reflect the current SkCanvas state. |
| 53 // The implementation may not return the same CGContext each time. | 52 // The implementation may not return the same CGContext each time. |
| 54 CGContextRef context() { return m_skiaBitLocker.cgContext(); } | 53 CGContextRef context() { return m_skiaBitLocker.cgContext(); } |
| 55 | 54 |
| 56 private: | 55 private: |
| 57 gfx::SkiaBitLocker m_skiaBitLocker; | 56 gfx::SkiaBitLocker m_skiaBitLocker; |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 } | 59 } |
| OLD | NEW |