fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / khtml / imload / canvasimage.h
blobeba44186c1e50060147d66b4af8110ed00926854
1 /*
2 KHTML image displaying library.
4 Copyright (C) 2007 Maks Orlovich (maksim@kde.org)
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 #ifndef IMLOAD_CANVAS_IMAGE_H
25 #define IMLOAD_CANVAS_IMAGE_H
27 class QImage;
29 #include "image.h"
31 namespace khtmlImLoad {
33 /**
34 A CanvasImage encapsulates a QImage that will be painted on externally,
35 in order to permit scaling of it. When drawing happens, however, the client must call the
36 contentUpdated() method to avoid out-of-date data being painted.
38 class CanvasImage : public Image
40 public:
41 CanvasImage(int width, int height);
42 void contentUpdated();
43 void resizeImage(int width, int height);
44 private:
45 void setupOriginalPlane(int width, int height);
46 void flushAllCaches();
47 static ImageOwner* trivialOwner();
48 static ImageOwner* s_trivialOwner;
53 #endif
54 // kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;