diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-13 15:54:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-23 14:25:58 +0000 |
commit | b0f5416d7ee7c988d316df7ffa0318fa6514e4de (patch) | |
tree | c196c9966ee53499559806050bb2f01195d91c23 /libreofficekit/source/gtk/tilebuffer.hxx | |
parent | e34f290eec4f3c8d42724f1602029f5680aecde6 (diff) |
Do all svp text rendering with cairo
enabling us to delete a whole pile of foo
For android we patch cairo, which is internal in that case, to swap the rgb
components so that cairo then matches the OpenGL GL_RGBA format so we can use
it there where we don't have GL_BGRA support.
Change-Id: I25e34889c7b7263438b143dd2a2ad882fb0f190a
Diffstat (limited to 'libreofficekit/source/gtk/tilebuffer.hxx')
-rw-r--r-- | libreofficekit/source/gtk/tilebuffer.hxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx index c8f401d38c0a..3d84dfb184e7 100644 --- a/libreofficekit/source/gtk/tilebuffer.hxx +++ b/libreofficekit/source/gtk/tilebuffer.hxx @@ -61,7 +61,8 @@ class Tile Tile() : valid(false), m_pBuffer(nullptr) {} ~Tile() { - g_clear_object(&m_pBuffer); + if (m_pBuffer) + cairo_surface_destroy(m_pBuffer); } /** @@ -70,14 +71,14 @@ class Tile */ bool valid; - /// Function to get the pointer to enclosing GdkPixbuf - GdkPixbuf* getBuffer(); + /// Function to get the pointer to enclosing cairo_surface_t + cairo_surface_t* getBuffer(); /// Used to set the pixel buffer of this object - void setPixbuf(GdkPixbuf*); + void setSurface(cairo_surface_t*); private: /// Pixel buffer data for this tile - GdkPixbuf *m_pBuffer; + cairo_surface_t *m_pBuffer; }; /** @@ -95,9 +96,9 @@ class TileBuffer : m_pLOKDocument(document) , m_nWidth(columns) { - GdkPixbuf* pPixBuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, nTileSizePixels, nTileSizePixels); - m_DummyTile.setPixbuf(pPixBuf); - g_object_unref(pPixBuf); + cairo_surface_t *pSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, nTileSizePixels, nTileSizePixels); + m_DummyTile.setSurface(pSurface); + cairo_surface_destroy(pSurface); } ~TileBuffer() {} |