mirror of
https://github.com/fltk/fltk.git
synced 2026-06-04 23:42:15 +08:00
Android: fixed some variables to avoid crashing.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12730 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user