summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-10 16:22:44 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-10 16:22:44 +0000
commit1cf4371b6908492952c0ef789e9f7566557d3cf1 (patch)
treee0326b21d3703c23095577ee23ed6fb5739a28ed /src/drivers
parent5591ba811aab2fc67255a4bc469e86ecc1fad37d (diff)
Android: fixed some variables to avoid crashing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12730 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.H5
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.cxx12
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx6
3 files changed, 13 insertions, 10 deletions
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.H b/src/drivers/Android/Fl_Android_Graphics_Driver.H
index 6e03e26da..2e2aaa8a9 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver.H
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver.H
@@ -110,7 +110,10 @@ protected:
void mask_bitmap(uchar **value) { mask_bitmap_ = value; }
int p_size;
POINT *p;
+#endif
public:
+ Fl_Android_Graphics_Driver() : pWindowRegion(0L) {}
+#if 0
Fl_GDI_Graphics_Driver() {mask_bitmap_ = NULL; gc_ = NULL; p_size = 0; p = NULL; depth = -1; origins = NULL;}
virtual ~Fl_GDI_Graphics_Driver() { if (p) free(p); delete[] origins;}
virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
@@ -187,7 +190,7 @@ protected:
void restore_clip();
void clip_region(Fl_Region r);
Fl_Region clip_region();
- static Fl_Complex_Region pWindowRegion;
+ Fl_Rect_Region *pWindowRegion;
#if 0
virtual Fl_Region scale_clip(float f);
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
index 2a0b62cc8..b71f1adbb 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
@@ -54,10 +54,14 @@ static uint16_t make565(Fl_Color crgba)
}
void Fl_Android_Graphics_Driver::rectf_unscaled(float x, float y, float w, float h) {
- Fl_Android_Application::log_w("rectf %g %g %g %g", x, y, w, h);
- Fl_Rect_Region r(x, y, w, h);
- if (r.intersect_with(&pWindowRegion)) {
- rectf_unclipped(r.x(), r.y(), r.w(), r.h());
+ if (pWindowRegion) {
+ Fl_Android_Application::log_w("rectf %g %g %g %g", x, y, w, h);
+ Fl_Rect_Region r(x, y, w, h);
+ if (r.intersect_with(pWindowRegion)) {
+ rectf_unclipped(r.x(), r.y(), r.w(), r.h());
+ }
+ } else {
+ rectf_unclipped(x, y, w, h);
}
/*
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
index 27e105d89..893f74010 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
@@ -23,10 +23,6 @@
#include <FL/platform.H>
-Fl_Complex_Region Fl_Android_Graphics_Driver::pWindowRegion;
-
-
-
// return 0 for empty, 1 for same, 2 if intersecting
int Fl_Rect_Region::intersect_with(Fl_Rect_Region *a)
{
@@ -98,7 +94,7 @@ void Fl_Android_Graphics_Driver::restore_clip()
// FIXME: scaling!
a.intersect_with(b);
}
- pWindowRegion.set(b);
+ pWindowRegion = b;
// FIXME: intersect with complex window region
}