| Index: core/cross/cairo/renderer_cairo.cc
|
| ===================================================================
|
| --- core/cross/cairo/renderer_cairo.cc (revision 66807)
|
| +++ core/cross/cairo/renderer_cairo.cc (working copy)
|
| @@ -73,7 +73,6 @@
|
| }
|
|
|
| void RendererCairo::Paint() {
|
| - DLOG(INFO) << "To paint";
|
| cairo_t* current_drawing = cairo_create(main_surface_);
|
|
|
| // Paint the background.
|
| @@ -87,10 +86,9 @@
|
|
|
| // Preparing and updating the Layer.
|
| Layer* cur = *i;
|
| - TextureCairo* cur_texture = cur->GetTexture();
|
| -
|
| - if (!cur_texture) {
|
| - // Skip layers with no texture assigned.
|
| + Pattern* pattern = cur->pattern();
|
| + if (!pattern) {
|
| + // Skip layers with no pattern assigned.
|
| continue;
|
| }
|
|
|
| @@ -99,23 +97,14 @@
|
| start_mask_it++;
|
| MaskArea(current_drawing, start_mask_it);
|
|
|
| - // Preparing the image to render.
|
| - cairo_surface_t* image = cur_texture->image_surface();
|
| + cairo_translate(current_drawing, cur->x(), cur->y());
|
|
|
| - // Scale the image.
|
| - double width_scaling =
|
| - (static_cast<double>(cur->GetScaleX())) / cur_texture->width();
|
| - double height_scaling =
|
| - (static_cast<double>(cur->GetScaleY())) / cur_texture->height();
|
| + cairo_scale(current_drawing, cur->scale_x(), cur->scale_y());
|
|
|
| - cairo_scale(current_drawing, width_scaling, height_scaling);
|
| -
|
| // Painting the image to the surface.
|
| - cairo_set_source_surface(current_drawing, image,
|
| - cur->GetTranslateX() / width_scaling,
|
| - cur->GetTranslateY() / height_scaling);
|
| + cairo_set_source(current_drawing, pattern->pattern());
|
|
|
| - cairo_paint_with_alpha(current_drawing, cur->GetAlpha());
|
| + cairo_paint_with_alpha(current_drawing, cur->alpha());
|
|
|
| // Restore to the state with no mask.
|
| cairo_restore(current_drawing);
|
| @@ -142,10 +131,10 @@
|
|
|
| cairo_rectangle(cr, 0, 0, display_width(), display_height());
|
| cairo_rectangle(cr,
|
| - cur_mask->GetTranslateX(),
|
| - cur_mask->GetTranslateY(),
|
| - static_cast<double>(cur_mask->GetScaleX()),
|
| - static_cast<double>(cur_mask->GetScaleY()));
|
| + cur_mask->x(),
|
| + cur_mask->y(),
|
| + cur_mask->width(),
|
| + cur_mask->height());
|
| cairo_clip(cr);
|
| }
|
| }
|
|
|