Kaydet (Commit) 2567d804 authored tarafından Caolán McNamara's avatar Caolán McNamara

drop temp surface and draw direct to backing basebmp surface

Change-Id: I370a0f635bea17729539e8b6da4c3f1d195ad43b
üst 563bfd69
...@@ -78,7 +78,7 @@ private: ...@@ -78,7 +78,7 @@ private:
static GtkStyleContext *mpComboboxStyle; static GtkStyleContext *mpComboboxStyle;
static GtkStyleContext *mpListboxStyle; static GtkStyleContext *mpListboxStyle;
void renderAreaToPix( cairo_surface_t* source, cairo_rectangle_int_t *region ); void queue_draw_area(cairo_rectangle_int_t *region);
void getStyleContext( GtkStyleContext** style, GtkWidget* widget ); void getStyleContext( GtkStyleContext** style, GtkWidget* widget );
Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect ); Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect );
Rectangle NWGetSpinButtonRect( ControlPart nPart, Rectangle aAreaRect); Rectangle NWGetSpinButtonRect( ControlPart nPart, Rectangle aAreaRect);
......
...@@ -912,9 +912,9 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co ...@@ -912,9 +912,9 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
cairo_rectangle_int_t translatedRegion = { (int) rControlRegion.Left() - 1, (int) rControlRegion.Top() - 1, cairo_rectangle_int_t translatedRegion = { (int) rControlRegion.Left() - 1, (int) rControlRegion.Top() - 1,
(int) rControlRegion.GetWidth() + 2, (int) rControlRegion.GetHeight() + 2 }; (int) rControlRegion.GetWidth() + 2, (int) rControlRegion.GetHeight() + 2 };
cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
translatedRegion.width, translatedRegion.height); cairo_t *cr = getCairoContext();
cairo_t *cr = cairo_create(surface); cairo_translate(cr, translatedRegion.x, translatedRegion.y);
gtk_style_context_save(context); gtk_style_context_save(context);
gtk_style_context_set_state(context, flags); gtk_style_context_set_state(context, flags);
...@@ -963,21 +963,13 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co ...@@ -963,21 +963,13 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
} }
cairo_destroy(cr); // unref cairo_destroy(cr); // unref
renderAreaToPix(surface, &translatedRegion); queue_draw_area(&translatedRegion);
cairo_surface_destroy(surface); // unref
return true; return true;
} }
void GtkSalGraphics::renderAreaToPix( cairo_surface_t *source, void GtkSalGraphics::queue_draw_area(cairo_rectangle_int_t *region)
cairo_rectangle_int_t *region)
{ {
cairo_t *cr = getCairoContext();
cairo_set_source_surface(cr, source, region->x, region->y);
cairo_rectangle(cr, region->x, region->y, region->width, region->height);
cairo_fill(cr);
cairo_destroy(cr);
if (!mpFrame->isDuringRender()) if (!mpFrame->isDuringRender())
gtk_widget_queue_draw_area(mpFrame->getWindow(), region->x, region->y, region->width, region->height); gtk_widget_queue_draw_area(mpFrame->getWindow(), region->x, region->y, region->width, region->height);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment