Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: core/cross/cairo/renderer_cairo.cc

Issue 5276006: O2D:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/cross/cairo/pattern.cc ('k') | core/cross/class_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « core/cross/cairo/pattern.cc ('k') | core/cross/class_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698