diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-07 22:04:31 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-07 22:04:31 +0000 |
commit | 4d2692ae3cf879014d4094996561a8671428df2a (patch) | |
tree | 46703483aad74deccfab3e7a9d467ebbe13af2d8 | |
parent | 36f84bceb56e2dfa81efc5b2eec86b5c3d179e36 (diff) | |
download | chromium_src-4d2692ae3cf879014d4094996561a8671428df2a.zip chromium_src-4d2692ae3cf879014d4094996561a8671428df2a.tar.gz chromium_src-4d2692ae3cf879014d4094996561a8671428df2a.tar.bz2 |
Don't scale mask image for new tab button.
MatchScale's 2x routine uses canvas which can't scale mask image. This routine should be gone, so I fixed it in
tab_strip, rather than fixing this routine.
I'll flip the default value of the flag "scaling-in-image-skia-operation" so that mismatch will result in CHECK failure.
BUG=163372
TEST=none
Review URL: https://codereview.chromium.org/11684002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175394 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/tabs/tab_strip.cc | 5 | ||||
-rw-r--r-- | ui/gfx/image/image_skia_operations.cc | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index a7aa6ba..8a384b6 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -426,6 +426,11 @@ gfx::ImageSkia NewTabButton::GetBackgroundImage( GetThemeProvider()->GetImageSkiaNamed(IDR_NEWTAB_BUTTON_MASK); int height = mask->height(); int width = mask->width(); + + // The canvas and mask has to use the same scale factor. + if (!mask->HasRepresentation(scale_factor)) + scale_factor = ui::SCALE_FACTOR_100P; + gfx::Canvas canvas(gfx::Size(width, height), scale_factor, false); // For custom images the background starts at the top of the tab strip. diff --git a/ui/gfx/image/image_skia_operations.cc b/ui/gfx/image/image_skia_operations.cc index b07993d..b0940d1 100644 --- a/ui/gfx/image/image_skia_operations.cc +++ b/ui/gfx/image/image_skia_operations.cc @@ -167,7 +167,6 @@ class MaskedImageSource : public gfx::ImageSkiaSource { virtual ImageSkiaRep GetImageForScale(ui::ScaleFactor scale_factor) OVERRIDE { ImageSkiaRep rgb_rep = rgb_.GetRepresentation(scale_factor); ImageSkiaRep alpha_rep = alpha_.GetRepresentation(scale_factor); - MatchScale(&rgb_rep, &alpha_rep); return ImageSkiaRep(SkBitmapOperations::CreateMaskedBitmap( rgb_rep.sk_bitmap(), alpha_rep.sk_bitmap()), rgb_rep.scale_factor()); |