summaryrefslogtreecommitdiff
path: root/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-14 21:46:01 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-14 21:46:01 +0000
commit737d8bef2425d0373a8890b49f9b0babb7f994db (patch)
treec8f001d89469dcc66831d4c3f633667910d950af /src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
parentc023f26fb0fd5107d520c2170c975d27ab7260f9 (diff)
Android: adding stress test for complex clipping.
Complex clipping is needed to allow popup dialogs and menu window while still correctly rendering windows that are "below" those popups. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12745 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx')
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx68
1 files changed, 48 insertions, 20 deletions
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
index e3ffafc54..2e71cfb29 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx
@@ -147,15 +147,62 @@ void Fl_Rect_Region::print(const char *label) const
Fl_Android_Application::log_i("Rect %d %d %d %d", x(), y(), w(), h());
}
+// -----------------------------------------------------------------------------
-#if 0
+/**
+ * Create an empty complex region.
+ */
+Fl_Complex_Region::Fl_Complex_Region() :
+ Fl_Rect_Region()
+{
+}
+
+/**
+ * Create a complex region with the same bounds as the give rect.
+ * @param r region size
+ */
+Fl_Complex_Region::Fl_Complex_Region(const Fl_Rect_Region &r) :
+ Fl_Rect_Region(r)
+{
+}
+/**
+ * Delete this region, all subregions recursively, and all following regions.
+ */
Fl_Complex_Region::~Fl_Complex_Region()
{
delete pSubregion; // recursively delete all subregions
delete pNext; // recursively delete all following regions
}
+/**
+ * Print the entire content of this region recursively.
+ */
+void Fl_Complex_Region::print(const char *label) const
+{
+ Fl_Android_Application::log_i("---> Fl_Complex_Region: %s", label);
+ print_data(0);
+}
+
+/*
+ * Print the rectangular data only.
+ */
+void Fl_Complex_Region::print_data(int indent) const
+{
+ static const char *space = " ";
+ if (pSubregion) {
+ Fl_Android_Application::log_i("%sBBox %d %d %d %d", space+16-indent, x(), y(), w(), h());
+ pSubregion->print_data(indent+1);
+ } else {
+ Fl_Android_Application::log_i("%sRect %d %d %d %d", space+16-indent, x(), y(), w(), h());
+ }
+ if (pNext) {
+ pNext->print_data(indent+1);
+ }
+}
+
+
+#if 0
void Fl_Complex_Region::set(int x, int y, int w, int h)
{
@@ -167,7 +214,6 @@ void Fl_Complex_Region::set(int x, int y, int w, int h)
Fl_Rect_Region::set(x, y, w, h);
}
-
void Fl_Complex_Region::set(Fl_Rect *rect)
{
delete pSubregion;
@@ -198,13 +244,11 @@ void Fl_Complex_Region::subtract(Fl_Rect *r)
int x = 3;
}
-
void Fl_Complex_Region::intersect(Fl_Rect*)
{
// FIXME: implement
}
-
void Fl_Complex_Region::clone(Fl_Complex_Region *r)
{
// FIXME: implement
@@ -220,22 +264,6 @@ void Fl_Complex_Region::clone(Fl_Complex_Region *r)
}
}
-
-void Fl_Complex_Region::print_data(int indent)
-{
- static const char *space = " ";
- if (pSubregion) {
- Fl_Android_Application::log_i("%sBBox %d %d %d %d", space+16-indent, x(), y(), w(), h());
- pSubregion->print_data(indent+1);
- } else {
- Fl_Android_Application::log_i("%sRect %d %d %d %d", space+16-indent, x(), y(), w(), h());
- }
- if (pNext) {
- pNext->print_data(indent+1);
- }
-}
-
-
void Fl_Complex_Region::print()
{
Fl_Android_Application::log_i("-------- begin region");