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

Unified Diff: chrome/browser/views/download_item_view.cc

Issue 2811032: Revert 50784 - 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/views/download_item_view.cc
===================================================================
--- chrome/browser/views/download_item_view.cc (revision 50789)
+++ chrome/browser/views/download_item_view.cc (working copy)
@@ -20,7 +20,7 @@
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/views/download_shelf_view.h"
-#include "gfx/canvas_skia.h"
+#include "gfx/canvas.h"
#include "gfx/color_utils.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -515,7 +515,7 @@
// (hot_)body_image_set->bottom_left, and drop_down_image_set,
// for RTL UI, we flip the canvas to draw those images mirrored.
// Consequently, we do not need to mirror the x-axis of those images.
- canvas->AsCanvasSkia()->save();
+ canvas->save();
canvas->TranslateInt(width(), 0);
canvas->ScaleInt(-1, 1);
}
@@ -536,10 +536,10 @@
// Overlay our body hot state.
if (body_hover_animation_->GetCurrentValue() > 0) {
- canvas->AsCanvasSkia()->saveLayerAlpha(NULL,
+ canvas->saveLayerAlpha(NULL,
static_cast<int>(body_hover_animation_->GetCurrentValue() * 255),
SkCanvas::kARGB_NoClipLayer_SaveFlag);
- canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
+ canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
int x = kLeftPadding;
PaintBitmaps(canvas,
@@ -557,10 +557,10 @@
hot_body_image_set_.bottom_right,
x, box_y_, box_height_,
hot_body_image_set_.top_right->width());
- canvas->AsCanvasSkia()->restore();
+ canvas->restore();
if (rtl_ui) {
- canvas->AsCanvasSkia()->restore();
- canvas->AsCanvasSkia()->save();
+ canvas->restore();
+ canvas->save();
// Flip it for drawing drop-down images for RTL locales.
canvas->TranslateInt(width(), 0);
canvas->ScaleInt(-1, 1);
@@ -578,19 +578,17 @@
// Overlay our drop-down hot state.
if (drop_hover_animation_->GetCurrentValue() > 0) {
- canvas->AsCanvasSkia()->saveLayerAlpha(
- NULL,
+ canvas->saveLayerAlpha(NULL,
static_cast<int>(drop_hover_animation_->GetCurrentValue() * 255),
SkCanvas::kARGB_NoClipLayer_SaveFlag);
- canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255,
- SkXfermode::kClear_Mode);
+ canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
PaintBitmaps(canvas,
drop_down_image_set->top, drop_down_image_set->center,
drop_down_image_set->bottom,
x, box_y_, box_height_, drop_down_image_set->top->width());
- canvas->AsCanvasSkia()->restore();
+ canvas->restore();
}
}
@@ -598,7 +596,7 @@
// Restore the canvas to avoid file name etc. text are drawn flipped.
// Consequently, the x-axis of following canvas->DrawXXX() method should be
// mirrored so the text and images are down in the right positions.
- canvas->AsCanvasSkia()->restore();
+ canvas->restore();
}
// Print the text, left aligned and always print the file extension.

Powered by Google App Engine
This is Rietveld 408576698