save some memory
This commit is contained in:
parent
a48d734251
commit
08f6ca0514
2 changed files with 15 additions and 9 deletions
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: GContext.cc,v 1.5 2003/11/28 22:50:55 fluxgen Exp $
|
||||
// $Id: GContext.cc,v 1.6 2004/01/09 01:19:48 fluxgen Exp $
|
||||
|
||||
#include "GContext.hh"
|
||||
|
||||
|
@ -31,27 +31,33 @@
|
|||
|
||||
namespace FbTk {
|
||||
|
||||
Display *GContext::m_display = 0;
|
||||
|
||||
GContext::GContext(const FbTk::FbDrawable &drawable):
|
||||
m_display(FbTk::App::instance()->display()),
|
||||
m_gc(XCreateGC(m_display,
|
||||
m_gc(XCreateGC(m_display != 0 ? m_display : FbTk::App::instance()->display(),
|
||||
drawable.drawable(),
|
||||
0, 0)) {
|
||||
if (m_display == 0)
|
||||
m_display = FbTk::App::instance()->display();
|
||||
|
||||
setGraphicsExposure(false);
|
||||
}
|
||||
|
||||
GContext::GContext(Drawable drawable):
|
||||
m_display(FbTk::App::instance()->display()),
|
||||
m_gc(XCreateGC(m_display,
|
||||
m_gc(XCreateGC(m_display != 0 ? m_display : FbTk::App::instance()->display(),
|
||||
drawable,
|
||||
0, 0)) {
|
||||
if (m_display == 0)
|
||||
m_display = FbTk::App::instance()->display();
|
||||
setGraphicsExposure(false);
|
||||
}
|
||||
|
||||
GContext::GContext(Drawable d, const GContext &gc):
|
||||
m_display(FbTk::App::instance()->display()),
|
||||
m_gc(XCreateGC(m_display,
|
||||
m_gc(XCreateGC(m_display != 0 ? m_display : FbTk::App::instance()->display(),
|
||||
d,
|
||||
0, 0)) {
|
||||
if (m_display == 0)
|
||||
m_display = FbTk::App::instance()->display();
|
||||
setGraphicsExposure(false);
|
||||
copy(gc);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: GContext.hh,v 1.6 2003/12/16 17:06:51 fluxgen Exp $
|
||||
// $Id: GContext.hh,v 1.7 2004/01/09 01:19:48 fluxgen Exp $
|
||||
|
||||
#ifndef FBTK_GCONTEXT_HH
|
||||
#define FBTK_GCONTEXT_HH
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
private:
|
||||
GContext(const GContext &cont);
|
||||
|
||||
Display *m_display; // worth caching
|
||||
static Display *m_display; // worth caching
|
||||
GC m_gc;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue