/work/obj-fuzz/dist/include/mozilla/widget/WindowSurface.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
2 | | * |
3 | | * This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef _MOZILLA_WIDGET_WINDOW_SURFACE_H |
8 | | #define _MOZILLA_WIDGET_WINDOW_SURFACE_H |
9 | | |
10 | | #include "mozilla/gfx/2D.h" |
11 | | #include "Units.h" |
12 | | |
13 | | namespace mozilla { |
14 | | namespace widget { |
15 | | |
16 | | // A class for drawing to double-buffered windows. |
17 | | class WindowSurface { |
18 | | public: |
19 | 0 | virtual ~WindowSurface() {} |
20 | | |
21 | | // Locks a region of the window for drawing, returning a draw target |
22 | | // capturing the bounds of the provided region. |
23 | | // Implementations must permit invocation from any thread. |
24 | | virtual already_AddRefed<gfx::DrawTarget> Lock(const LayoutDeviceIntRegion& aRegion) = 0; |
25 | | |
26 | | // Swaps the provided invalid region from the back buffer to the window. |
27 | | // Implementations must permit invocation from any thread. |
28 | | virtual void Commit(const LayoutDeviceIntRegion& aInvalidRegion) = 0; |
29 | | |
30 | | // Whether the window surface represents a fallback method. |
31 | 0 | virtual bool IsFallback() const { return false; } |
32 | | }; |
33 | | |
34 | | } // namespace widget |
35 | | } // namespace mozilla |
36 | | |
37 | | #endif // _MOZILLA_WIDGET_WINDOW_SURFACE_H |