diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 3c784a96b..7a1766505 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -956,7 +956,10 @@ SSEFUNCTION void HistogramArea::updateBackBuffer () Cairo::RefPtr cr = Cairo::Context::create(surface); const Glib::RefPtr style = get_style_context(); - style->render_background(cr, 0, 0, surface->get_width(), surface->get_height()); + cr->set_source_rgba (0., 0., 0., 0.); + cr->set_operator (Cairo::OPERATOR_CLEAR); + cr->paint (); + cr->set_operator (Cairo::OPERATOR_OVER); if (valid) { // For RAW mode use the other hists @@ -1215,6 +1218,8 @@ bool HistogramArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) updateBackBuffer (); } + Glib::RefPtr style = get_style_context(); + style->render_background(cr, winx, winy, winw, winh); copySurface(cr, NULL); return true; diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index 91dca73c5..e50f77106 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -210,9 +210,7 @@ void MyDiagonalCurve::draw (int handle) return; } - Glib::RefPtr win = get_window(); - - if (!surfaceCreated() || !win) { + if (!surfaceCreated()) { return; } @@ -232,7 +230,10 @@ void MyDiagonalCurve::draw (int handle) cr->set_line_cap(Cairo::LINE_CAP_SQUARE); // clear background - style->render_background(cr, 0., 0., double(getWidth()), double(getHeight())); + cr->set_source_rgba (0., 0., 0., 0.); + cr->set_operator (Cairo::OPERATOR_CLEAR); + cr->paint (); + cr->set_operator (Cairo::OPERATOR_OVER); Gdk::RGBA c; @@ -425,7 +426,7 @@ void MyDiagonalCurve::draw (int handle) // first the background int bWidth = CBAR_WIDTH; BackBuffer *bb = this; - leftBar->setDrawRectangle(win, 1, graphY - graphH + 1, bWidth - 2, graphH - 2); + leftBar->setDrawRectangle(Cairo::FORMAT_ARGB32, 1, graphY - graphH + 1, bWidth - 2, graphH - 2); leftBar->expose(bb); // now the border @@ -440,7 +441,7 @@ void MyDiagonalCurve::draw (int handle) // first the background int bWidth = CBAR_WIDTH; BackBuffer *bb = this; - bottomBar->setDrawRectangle(win, graphX + 1, graphY + CBAR_MARGIN + 1, graphW - 2, bWidth - 2); + bottomBar->setDrawRectangle(Cairo::FORMAT_ARGB32, graphX + 1, graphY + CBAR_MARGIN + 1, graphW - 2, bWidth - 2); bottomBar->expose(bb); // now the border @@ -497,13 +498,12 @@ void MyDiagonalCurve::draw (int handle) bool MyDiagonalCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) { - Glib::RefPtr win = get_window(); Gtk::Allocation allocation = get_allocation(); allocation.set_x(0); allocation.set_y(0); // setDrawRectangle will allocate the backbuffer Surface - if (setDrawRectangle(win, allocation)) { + if (setDrawRectangle(Cairo::FORMAT_ARGB32, allocation)) { setDirty(true); if (prevGraphW > GRAPH_SIZE || graphW > GRAPH_SIZE) { @@ -511,6 +511,8 @@ bool MyDiagonalCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) } } + Glib::RefPtr style = get_style_context(); + style->render_background(cr, 0., 0., (double)get_width(), (double)get_height()); draw (lit_point); copySurface(cr); return false; diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index ad1e2fc41..b0abb4e1f 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -116,9 +116,7 @@ void MyFlatCurve::draw () return; } - Glib::RefPtr win = get_window(); - - if (!surfaceCreated() || !win) { + if (!surfaceCreated()) { return; } @@ -139,7 +137,10 @@ void MyFlatCurve::draw () cr->set_line_cap(Cairo::LINE_CAP_SQUARE); // clear background - style->render_background(cr, 0., 0., double(getWidth()), double(getHeight())); + cr->set_source_rgba (0., 0., 0., 0.); + cr->set_operator (Cairo::OPERATOR_CLEAR); + cr->paint (); + cr->set_operator (Cairo::OPERATOR_OVER); Gdk::RGBA c; @@ -166,7 +167,7 @@ void MyFlatCurve::draw () // first the background int bWidth = CBAR_WIDTH; BackBuffer *bb = this; - leftBar->setDrawRectangle(win, 1, graphY - graphH + 1, bWidth - 2, graphH - 2); + leftBar->setDrawRectangle(Cairo::FORMAT_ARGB32, 1, graphY - graphH + 1, bWidth - 2, graphH - 2); leftBar->expose(bb); // now the border @@ -181,7 +182,7 @@ void MyFlatCurve::draw () // first the background int bWidth = CBAR_WIDTH; BackBuffer *bb = this; - bottomBar->setDrawRectangle(win, graphX + 1, graphY + CBAR_MARGIN + 1, graphW - 2, bWidth - 2); + bottomBar->setDrawRectangle(Cairo::FORMAT_ARGB32, graphX + 1, graphY + CBAR_MARGIN + 1, graphW - 2, bWidth - 2); bottomBar->expose(bb); // now the border @@ -501,13 +502,12 @@ void MyFlatCurve::draw () bool MyFlatCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) { - Glib::RefPtr win = get_window(); Gtk::Allocation allocation = get_allocation(); allocation.set_x(0); allocation.set_y(0); // setDrawRectangle will allocate the backbuffer Surface - if (setDrawRectangle(win, allocation)) { + if (setDrawRectangle(Cairo::FORMAT_ARGB32, allocation)) { setDirty(true); if (prevGraphW > GRAPH_SIZE || graphW > GRAPH_SIZE) { @@ -515,6 +515,8 @@ bool MyFlatCurve::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) } } + Glib::RefPtr style = get_style_context(); + style->render_background(cr, 0., 0., (double)get_width(), (double)get_height()); draw (); copySurface(cr); return false;