summaryrefslogtreecommitdiff
path: root/NxWidgets/libnxwidgets/src/cgraphicsport.cxx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-07 21:25:24 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-07 21:25:24 +0000
commit9bc51533db436502b50aaa0014aa272576968df2 (patch)
tree69130cca051fdf38817fd4c99502b30f804981e8 /NxWidgets/libnxwidgets/src/cgraphicsport.cxx
parent1d7b4d2140b3d4dec9554a333e0e442103e3708f (diff)
downloadnuttx-9bc51533db436502b50aaa0014aa272576968df2.tar.gz
nuttx-9bc51533db436502b50aaa0014aa272576968df2.tar.bz2
nuttx-9bc51533db436502b50aaa0014aa272576968df2.zip
Various fixes for running the NxWM unit test on the STM3240G-EVAL
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4711 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/libnxwidgets/src/cgraphicsport.cxx')
-rw-r--r--NxWidgets/libnxwidgets/src/cgraphicsport.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/NxWidgets/libnxwidgets/src/cgraphicsport.cxx b/NxWidgets/libnxwidgets/src/cgraphicsport.cxx
index 43076e240..d43f3bdfa 100644
--- a/NxWidgets/libnxwidgets/src/cgraphicsport.cxx
+++ b/NxWidgets/libnxwidgets/src/cgraphicsport.cxx
@@ -105,13 +105,23 @@ using namespace NXWidgets;
/**
* Constructor.
*
- * @param pNxWnd An instance of the underlying window type.
+ * @param pNxWnd. An instance of the underlying window type.
+ * @param backColor. The background color is only needed if we
+ * cannot read from the graphics device.
*/
+#ifdef CONFIG_NX_WRITEONLY
+CGraphicsPort::CGraphicsPort(INxWindow *pNxWnd, nxgl_mxpixel_t backColor)
+{
+ m_pNxWnd = pNxWnd;
+ m_backColor = backColor;
+}
+#else
CGraphicsPort::CGraphicsPort(INxWindow *pNxWnd)
{
m_pNxWnd = pNxWnd;
}
+#endif
/**
* Destructor.
@@ -673,10 +683,6 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound,
// Loop setup
-#if 0
- nxwidget_pixel_t backcolor = g_defaultWidgetStyle->colors.back;
-#endif
-
struct SBitmap bitmap;
bitmap.bpp = CONFIG_NXWIDGETS_BPP;
bitmap.fmt = CONFIG_NXWIDGETS_FMT;
@@ -736,14 +742,14 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound,
// Sometimes a solid background works, sometimes not. But reading
// from graphics memory always works.
-#if 0
+#ifdef CONFIG_NX_WRITEONLY
// Set the glyph memory to the background color
nxwidget_pixel_t *bmPtr = (nxwidget_pixel_t *)bitmap.data;
unsigned int npixels = fontWidth * fontHeight;
for (unsigned int j = 0; j < npixels; j++)
{
- *bmPtr++ = backcolor;
+ *bmPtr++ = m_backColor;
}
#else
// Read the current contents of the destination into the glyph memory