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

Unified Diff: chrome/browser/gtk/tabs/tab_renderer_gtk.cc

Issue 2825018: Canvas refactoring part 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months 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
Index: chrome/browser/gtk/tabs/tab_renderer_gtk.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_renderer_gtk.cc (revision 50664)
+++ chrome/browser/gtk/tabs/tab_renderer_gtk.cc (working copy)
@@ -619,13 +619,13 @@
}
SkBitmap TabRendererGtk::PaintBitmap() {
- gfx::Canvas canvas(width(), height(), false);
+ gfx::CanvasSkia canvas(width(), height(), false);
Paint(&canvas);
return canvas.ExtractBitmap();
}
cairo_surface_t* TabRendererGtk::PaintToSurface() {
- gfx::Canvas canvas(width(), height(), false);
+ gfx::CanvasSkia canvas(width(), height(), false);
Paint(&canvas);
return cairo_surface_reference(cairo_get_target(canvas.beginPlatformPaint()));
}
@@ -804,7 +804,7 @@
if (loading_animation_.animation_state() != ANIMATION_NONE) {
PaintLoadingAnimation(canvas);
} else {
- canvas->save();
+ canvas->AsCanvasSkia()->save();
canvas->ClipRectInt(0, 0, width(), height() - kFavIconTitleSpacing);
if (should_display_crashed_favicon_) {
canvas->DrawBitmapInt(*crashed_fav_icon, 0, 0,
@@ -818,8 +818,9 @@
if (!data_.favicon.isNull()) {
if (data_.is_default_favicon && theme_provider_->UseGtkTheme()) {
GdkPixbuf* favicon = GtkThemeProvider::GetDefaultFavicon(true);
- canvas->DrawGdkPixbuf(favicon, favicon_bounds_.x(),
- favicon_bounds_.y() + fav_icon_hiding_offset_);
+ canvas->AsCanvasSkia()->DrawGdkPixbuf(
+ favicon, favicon_bounds_.x(),
+ favicon_bounds_.y() + fav_icon_hiding_offset_);
} else {
// TODO(pkasting): Use code in tab_icon_view.cc:PaintIcon() (or switch
// to using that class to render the favicon).
@@ -833,7 +834,7 @@
}
}
}
- canvas->restore();
+ canvas->AsCanvasSkia()->restore();
}
}
@@ -847,11 +848,13 @@
if (throb_value > 0) {
SkRect bounds;
bounds.set(0, 0, SkIntToScalar(width()), SkIntToScalar(height()));
- canvas->saveLayerAlpha(&bounds, static_cast<int>(throb_value * 0xff),
- SkCanvas::kARGB_ClipLayer_SaveFlag);
- canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
+ canvas->AsCanvasSkia()->saveLayerAlpha(
+ &bounds, static_cast<int>(throb_value * 0xff),
+ SkCanvas::kARGB_ClipLayer_SaveFlag);
+ canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255,
+ SkXfermode::kClear_Mode);
PaintActiveTabBackground(canvas);
- canvas->restore();
+ canvas->AsCanvasSkia()->restore();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698