| OLD | NEW |
| 1 // Copyright (C) 2013 Google Inc. All rights reserved. | 1 // Copyright 2014, Google Inc. |
| 2 // All rights reserved. |
| 2 // | 3 // |
| 3 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 5 // met: | 6 // met: |
| 6 // | 7 // |
| 7 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 9 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| 10 // copyright notice, this list of conditions and the following disclaimer | 11 // copyright notice, this list of conditions and the following disclaimer |
| 11 // in the documentation and/or other materials provided with the | 12 // in the documentation and/or other materials provided with the |
| 12 // distribution. | 13 // distribution. |
| 13 // * Neither the name of Google Inc. nor the names of its | 14 // * Neither the name of Google Inc. nor the names of its |
| 14 // contributors may be used to endorse or promote products derived from | 15 // contributors may be used to endorse or promote products derived from |
| 15 // this software without specific prior written permission. | 16 // this software without specific prior written permission. |
| 16 // | 17 // |
| 17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 29 |
| 29 #ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATESAVER_H_ | 30 #include "config.h" |
| 30 #define SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATESAVER_H_ | |
| 31 | 31 |
| 32 #include "sky/engine/platform/PlatformExport.h" | 32 #include "bindings/core/dart/DartJavaScriptCallFrame.h" |
| 33 #include "sky/engine/platform/graphics/GraphicsContext.h" | |
| 34 | 33 |
| 35 namespace blink { | 34 namespace blink { |
| 36 | 35 |
| 37 class PLATFORM_EXPORT GraphicsContextStateSaver { | 36 namespace DartJavaScriptCallFrameInternal { |
| 38 WTF_MAKE_FAST_ALLOCATED; | |
| 39 public: | |
| 40 GraphicsContextStateSaver(GraphicsContext& context, bool saveAndRestore = tr
ue) | |
| 41 : m_context(context) | |
| 42 , m_saveAndRestore(saveAndRestore) | |
| 43 { | |
| 44 if (m_saveAndRestore) | |
| 45 m_context.save(); | |
| 46 } | |
| 47 | 37 |
| 48 ~GraphicsContextStateSaver() | 38 void evaluateCallback(Dart_NativeArguments args) |
| 49 { | 39 { |
| 50 if (m_saveAndRestore) | 40 // FIXME: proper implementation. |
| 51 m_context.restore(); | 41 DART_UNIMPLEMENTED(); |
| 52 } | 42 } |
| 53 | 43 |
| 54 void save() | 44 void evaluateWithExceptionDetailsCallback(Dart_NativeArguments args) |
| 55 { | 45 { |
| 56 ASSERT(!m_saveAndRestore); | 46 // FIXME: proper implementation. |
| 57 m_context.save(); | 47 DART_UNIMPLEMENTED(); |
| 58 m_saveAndRestore = true; | 48 } |
| 59 } | |
| 60 | 49 |
| 61 void restore() | 50 void restartCallback(Dart_NativeArguments args) |
| 62 { | 51 { |
| 63 ASSERT(m_saveAndRestore); | 52 // FIXME: proper implementation. |
| 64 m_context.restore(); | 53 DART_UNIMPLEMENTED(); |
| 65 m_saveAndRestore = false; | 54 } |
| 66 } | |
| 67 | 55 |
| 68 GraphicsContext* context() const { return &m_context; } | 56 void scopeTypeCallback(Dart_NativeArguments args) |
| 69 bool saved() const { return m_saveAndRestore; } | 57 { |
| 58 // FIXME: proper implementation. |
| 59 DART_UNIMPLEMENTED(); |
| 60 } |
| 70 | 61 |
| 71 private: | 62 void scopeChainGetter(Dart_NativeArguments args) |
| 72 GraphicsContext& m_context; | 63 { |
| 73 bool m_saveAndRestore; | 64 // FIXME: proper implementation. |
| 74 }; | 65 DART_UNIMPLEMENTED(); |
| 66 } |
| 75 | 67 |
| 76 } // namespace blink | 68 void thisObjectGetter(Dart_NativeArguments args) |
| 69 { |
| 70 // FIXME: proper implementation. |
| 71 DART_UNIMPLEMENTED(); |
| 72 } |
| 77 | 73 |
| 78 #endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATESAVER_H_ | 74 void typeGetter(Dart_NativeArguments args) |
| 75 { |
| 76 // FIXME: proper implementation. |
| 77 DART_UNIMPLEMENTED(); |
| 78 } |
| 79 |
| 80 void returnValueGetter(Dart_NativeArguments args) |
| 81 { |
| 82 // FIXME: proper implementation. |
| 83 DART_UNIMPLEMENTED(); |
| 84 } |
| 85 |
| 86 void lengthGetter(Dart_NativeArguments args) |
| 87 { |
| 88 // FIXME: proper implementation. |
| 89 DART_UNIMPLEMENTED(); |
| 90 } |
| 91 |
| 92 } |
| 93 |
| 94 } |
| OLD | NEW |