diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 15:22:13 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 15:22:13 +0000 |
commit | e1981f43505c69351e5786eac1bff1913f4c96db (patch) | |
tree | 9be2552eea732795716489cba689918dc5dd74a3 /chrome/common/gfx/chrome_canvas.cc | |
parent | 169da8f5bba74250fe73f708a1a3b666b4fb2431 (diff) | |
download | chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.zip chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.tar.gz chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.tar.bz2 |
Cleanup a few files, reduce the number of includes.
Applied glint.
No code change, just moving around.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gfx/chrome_canvas.cc')
-rw-r--r-- | chrome/common/gfx/chrome_canvas.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/chrome/common/gfx/chrome_canvas.cc b/chrome/common/gfx/chrome_canvas.cc index 631d2f3..b73a407 100644 --- a/chrome/common/gfx/chrome_canvas.cc +++ b/chrome/common/gfx/chrome_canvas.cc @@ -27,14 +27,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include <limits> - #include "chrome/common/gfx/chrome_canvas.h" -#include "base/gfx/platform_canvas.h" +#include <limits> + #include "base/gfx/rect.h" #include "base/logging.h" #include "skia/include/SkShader.h" +#include "chrome/common/gfx/chrome_font.h" +#include "chrome/common/l10n_util.h" ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque) : gfx::PlatformCanvas(width, height, is_opaque) { @@ -226,7 +227,8 @@ void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y, shader_scale.setScale( SkFloatToScalar(static_cast<float>(dest_w) / src_w), SkFloatToScalar(static_cast<float>(dest_h) / src_h)); - shader_scale.postTranslate(SkIntToScalar(dest_x - src_x), SkIntToScalar(dest_y - src_y)); + shader_scale.postTranslate(SkIntToScalar(dest_x - src_x), + SkIntToScalar(dest_y - src_y)); shader->setLocalMatrix(shader_scale); // Set up our paint to use the shader & release our reference (now just owned @@ -338,6 +340,15 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text, HFONT font, getTopPlatformDevice().postProcessGDI(x, y, w, h); } +void ChromeCanvas::DrawStringInt(const std::wstring& text, + const ChromeFont& font, + const SkColor& color, + int x, int y, + int w, int h) { + DrawStringInt(text, font, color, x, y, w, h, + l10n_util::DefaultCanvasTextAlignment()); +} + // We make sure that LTR text we draw in an RTL context is modified // appropriately to make sure it maintains it LTR orientation. void ChromeCanvas::DoDrawText(HDC hdc, const std::wstring& text, |