| 1 | /* |
| 2 | * Copyright (C) 2011,2014 Igalia S.L. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 | |
| 19 | #ifndef BackingStoreBackendCairo_h |
| 20 | #define BackingStoreBackendCairo_h |
| 21 | |
| 22 | #if USE(CAIRO) |
| 23 | |
| 24 | #include "IntRect.h" |
| 25 | #include "RefPtrCairo.h" |
| 26 | #include <wtf/FastMalloc.h> |
| 27 | #include <wtf/Noncopyable.h> |
| 28 | |
| 29 | typedef struct _cairo_surface cairo_surface_t; |
| 30 | |
| 31 | namespace WebCore { |
| 32 | |
| 33 | class BackingStoreBackendCairo { |
| 34 | WTF_MAKE_NONCOPYABLE(BackingStoreBackendCairo); |
| 35 | WTF_MAKE_FAST_ALLOCATED; |
| 36 | public: |
| 37 | virtual ~BackingStoreBackendCairo() = default; |
| 38 | |
| 39 | cairo_surface_t* surface() const { return m_surface.get(); } |
| 40 | const IntSize& size() const { return m_size; } |
| 41 | |
| 42 | virtual void scroll(const IntRect& scrollRect, const IntSize& scrollOffset) = 0; |
| 43 | |
| 44 | protected: |
| 45 | BackingStoreBackendCairo(const IntSize& size) |
| 46 | : m_size(size) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | RefPtr<cairo_surface_t> m_surface; |
| 51 | IntSize m_size; |
| 52 | }; |
| 53 | |
| 54 | |
| 55 | } // namespace WebCore |
| 56 | |
| 57 | #endif // USE(CAIRO) |
| 58 | |
| 59 | #endif // BackingStoreBackendCairo_h |
| 60 | |