diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 05:43:31 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 05:43:31 +0000 |
commit | f2705ac0994dd4eb07ce08c1d70b94a20eae016c (patch) | |
tree | fde36dc250d3590ad1e9f8347339ca811742c485 /chrome/common | |
parent | 398e5d1ce15fb26fc8172ba9963b86d9fd6765d5 (diff) | |
download | chromium_src-f2705ac0994dd4eb07ce08c1d70b94a20eae016c.zip chromium_src-f2705ac0994dd4eb07ce08c1d70b94a20eae016c.tar.gz chromium_src-f2705ac0994dd4eb07ce08c1d70b94a20eae016c.tar.bz2 |
Speculative Revert 120885 - ui/gfx: Make the first version of Canvas::TileImageInt take a gfx::Rect.
BUG=100898
R=pkasting@chromium.org
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9332006
TBR=tfarina@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9358015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/extensions/extension_action.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome/common/extensions/extension_action.cc b/chrome/common/extensions/extension_action.cc index 9845c31..284da0e 100644 --- a/chrome/common/extensions/extension_action.cc +++ b/chrome/common/extensions/extension_action.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,7 +15,6 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia.h" #include "ui/gfx/rect.h" -#include "ui/gfx/skia_util.h" namespace { @@ -146,9 +145,10 @@ void ExtensionAction::PaintBadge(gfx::Canvas* canvas, rect.fBottom = SkIntToScalar(bounds.bottom() - kBottomMargin); rect.fTop = rect.fBottom - SkIntToScalar(kBadgeHeight); if (badge_width >= kCenterAlignThreshold) { - rect.fLeft = SkScalarFloorToScalar(SkIntToScalar(bounds.x()) + - SkIntToScalar(bounds.width()) / 2 - - SkIntToScalar(badge_width) / 2); + rect.fLeft = SkIntToScalar( + SkScalarFloor(SkIntToScalar(bounds.x()) + + SkIntToScalar(bounds.width()) / 2 - + SkIntToScalar(badge_width) / 2)); rect.fRight = rect.fLeft + SkIntToScalar(badge_width); } else { rect.fRight = SkIntToScalar(bounds.right()); @@ -172,9 +172,12 @@ void ExtensionAction::PaintBadge(gfx::Canvas* canvas, IDR_BROWSER_ACTION_BADGE_CENTER); canvas->GetSkCanvas()->drawBitmap(*gradient_left, rect.fLeft, rect.fTop); - gfx::Rect tile_rect(gfx::SkRectToRect(rect)); - tile_rect.Inset(gradient_left->width(), 0, gradient_right->width(), 0); - canvas->TileImage(*gradient_center, tile_rect); + canvas->TileImageInt(*gradient_center, + SkScalarFloor(rect.fLeft) + gradient_left->width(), + SkScalarFloor(rect.fTop), + SkScalarFloor(rect.width()) - gradient_left->width() - + gradient_right->width(), + SkScalarFloor(rect.height())); canvas->GetSkCanvas()->drawBitmap(*gradient_right, rect.fRight - SkIntToScalar(gradient_right->width()), rect.fTop); |