Commit 4d2692ae authored by oshima@chromium.org's avatar oshima@chromium.org

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
parent 36f84bce
......@@ -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.
......
......@@ -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());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment