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

Unified Diff: ui/gfx/image/image_skia_operations.cc

Issue 10905005: Change browser/page action default icon defined in manifest to support hidpi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor cleanup Created 8 years, 4 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
« no previous file with comments | « chrome/test/data/extensions/manifest_tests/script_badge_basic.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia_operations.cc
diff --git a/ui/gfx/image/image_skia_operations.cc b/ui/gfx/image/image_skia_operations.cc
index c47b89b14d764b7d5c58783c69ff98ac66d1c7ec..36ad950f8288614ce279121b8a3c7ed9a54d6033 100644
--- a/ui/gfx/image/image_skia_operations.cc
+++ b/ui/gfx/image/image_skia_operations.cc
@@ -131,15 +131,14 @@ class TransparentImageSource : public gfx::ImageSkiaSource {
virtual ImageSkiaRep GetImageForScale(ui::ScaleFactor scale_factor) OVERRIDE {
ImageSkiaRep image_rep = image_.GetRepresentation(scale_factor);
SkBitmap alpha;
- const float scale = ui::GetScaleFactorScale(image_rep.scale_factor());
alpha.setConfig(SkBitmap::kARGB_8888_Config,
- static_cast<int>(image_.size().width() * scale),
pkotwicz 2012/08/29 22:07:43 Can't you use ImageSkiaRep::GetWidth() and ImageSk
tbarzic 2012/08/29 22:18:13 Won't that return rep's size in dip? I need actual
pkotwicz 2012/08/29 23:14:47 Sorry. My bad. You can use ImageSkiaRep::pixel_wid
tbarzic 2012/08/29 23:25:56 yeah, now I feel silly for not noticing those two
- static_cast<int>(image_.size().height() * scale));
+ static_cast<int>(image_rep.sk_bitmap().width()),
+ static_cast<int>(image_rep.sk_bitmap().height()));
alpha.allocPixels();
alpha.eraseColor(SkColorSetARGB(alpha_ * 256, 0, 0, 0));
- return ImageSkiaRep(SkBitmapOperations::CreateMaskedBitmap(
- image_rep.sk_bitmap(), alpha),
- image_rep.scale_factor());
+ return ImageSkiaRep(
+ SkBitmapOperations::CreateMaskedBitmap(image_rep.sk_bitmap(), alpha),
+ image_rep.scale_factor());
}
ImageSkia image_;
« no previous file with comments | « chrome/test/data/extensions/manifest_tests/script_badge_basic.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698