176{
178
179 cairo_rectangle_int_t
const presentationArea = pa.
toGdkRectangle();
180
181 cairo_rectangle_int_t viewArea;
182 viewArea.x = 0;
183 viewArea.y = 0;
184
185 if(zoom > 0)
186 {
187 const int pixelSize = 1 << zoom;
188 viewArea.width = presentationArea.width * pixelSize;
189 viewArea.height = presentationArea.height * pixelSize;
190 }
191 else
192 {
193 const int pixelSize = 1 << -zoom;
194 viewArea.width = presentationArea.width / pixelSize;
195 viewArea.height = presentationArea.height / pixelSize;
196 }
197
198 BitmapSurface::Ptr
const s = BitmapSurface::create(viewArea.width, viewArea.height, CAIRO_FORMAT_ARGB32);
199 cairo_surface_t*
surface =
s->get();
200 cairo_t* cr_sub = cairo_create(
surface);
201
203
204 for(
size_t i = 0; i <
children.size(); i++)
205 {
206 if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
buttons[i])))
207 {
209
211 bool hasTransparentBackground = false;
213 {
215 {
216 c->disableTransparentBackground();
217 }
218 else
219 {
220 c->setTransparentBackground();
221 hasTransparentBackground = true;
222 }
223 }
224
225 cairo_save(cr_sub);
226 cairo_set_operator(cr_sub, CAIRO_OPERATOR_CLEAR);
227 cairo_paint(cr_sub);
228 cairo_restore(cr_sub);
229
230 cairo_save(cr_sub);
232 cairo_restore(cr_sub);
233
234 cairo_set_source_surface(
cr,
surface, 0, 0);
235
236 if(hasTransparentBackground)
237 {
239 }
240 else
241 {
242 cairo_paint_with_alpha(
cr, 1.0 / (
count + 1));
243 }
244
245 if(!hasTransparentBackground)
246 {
248 }
249 }
250 }
251
253}
std::shared_ptr< Colormappable > Ptr
Definition colormappable.hh:114
Definition bitmap-helpers.hh:23
cairo_rectangle_int_t toGdkRectangle() const
Definition rectangle.hh:62
const std::string TRANSPARENT_BACKGROUND_PROPERTY_NAME
Definition colormappable.hh:21
const size_t count
Definition pageprovider-tests.cc:21