1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFXGDKNATIVERENDER_H_
7 #define GFXGDKNATIVERENDER_H_
12 #include "gfxXlibNativeRenderer.h"
18 * This class lets us take code that draws into an GDK drawable and lets us
19 * use it to draw into any Thebes context. The user should subclass this class,
20 * override DrawWithGDK, and then call Draw(). The drawing will be subjected
21 * to all Thebes transformations, clipping etc.
23 class gfxGdkNativeRenderer
25 : private gfxXlibNativeRenderer
30 * Perform the native drawing.
31 * @param offsetX draw at this offset into the given drawable
32 * @param offsetY draw at this offset into the given drawable
33 * @param clipRects an array of rects; clip to the union
34 * @param numClipRects the number of rects in the array, or zero if
35 * no clipping is required
39 // If set, then Draw() is opaque, i.e., every pixel in the intersection
40 // of the clipRect and (offset.x,offset.y,bounds.width,bounds.height)
41 // will be set and there is no dependence on what the existing pixels
42 // in the drawable are set to.
45 gfxXlibNativeRenderer::DRAW_IS_OPAQUE
49 // If set, then numClipRects can be zero or one.
50 // If not set, then numClipRects will be zero.
51 , DRAW_SUPPORTS_CLIP_RECT
=
53 gfxXlibNativeRenderer::DRAW_SUPPORTS_CLIP_RECT
60 * @param flags see above
61 * @param bounds Draw()'s drawing is guaranteed to be restricted to
62 * the rectangle (offset.x,offset.y,bounds.width,bounds.height)
63 * @param dpy a display to use for the drawing if ctx doesn't have one
68 // for gfxXlibNativeRenderer:
69 virtual nsresult
DrawWithXlib(cairo_surface_t
* surface
,
71 mozilla::gfx::IntRect
* clipRects
, uint32_t numClipRects
) override
;
76 #endif /*GFXGDKNATIVERENDER_H_*/