1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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 CANVASIMAGECACHE_H_
7 #define CANVASIMAGECACHE_H_
12 class HTMLCanvasElement
;
14 } // namespace mozilla
22 class CanvasImageCache
{
25 * Notify that image element aImage was (or is about to be) drawn to aCanvas
26 * using the first frame of aRequest's image. The data for the surface is
27 * in aSurface, and the image size is in aSize.
29 static void NotifyDrawImage(dom::Element
* aImage
,
30 dom::HTMLCanvasElement
* aCanvas
,
31 imgIRequest
* aRequest
,
32 gfxASurface
* aSurface
,
33 const gfxIntSize
& aSize
);
36 * Check whether aImage has recently been drawn into aCanvas. If we return
37 * a non-null surface, then the image was recently drawn into the canvas
38 * (with the same image request) and the returned surface contains the image
39 * data, and the image size will be returned in aSize.
41 static gfxASurface
* Lookup(dom::Element
* aImage
,
42 dom::HTMLCanvasElement
* aCanvas
,
48 #endif /* CANVASIMAGECACHE_H_ */