Backed out changeset 58dbd2146e24 (bug 944961) for bustage.
[gecko.git] / content / canvas / src / CanvasImageCache.h
blob91ae57ce490d3546ffbebbc65837a61fae795fe0
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_
9 namespace mozilla {
10 namespace dom {
11 class Element;
12 class HTMLCanvasElement;
13 } // namespace dom
14 } // namespace mozilla
15 class imgIRequest;
16 class gfxASurface;
18 #include "gfxPoint.h"
20 namespace mozilla {
22 class CanvasImageCache {
23 public:
24 /**
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);
35 /**
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,
43 gfxIntSize* aSize);
48 #endif /* CANVASIMAGECACHE_H_ */